summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2016-05-14 21:52:43 -0400
committerluxagraf <sng@luxagraf.net>2016-05-14 21:52:43 -0400
commit7945a5a48599677c07aff9740a625a428515eeb4 (patch)
tree1203bc9e5e33bd6f39d672aec127d265abb0d13e
parent6e1bbc2482dd43a9b438c73d644d9c684d55457d (diff)
fixed a bug that looked for pk before it was assigned
-rw-r--r--app/jrnl/models.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/jrnl/models.py b/app/jrnl/models.py
index abb9729..08d0721 100644
--- a/app/jrnl/models.py
+++ b/app/jrnl/models.py
@@ -186,10 +186,11 @@ class Entry(models.Model):
return self.get_next_by_pub_date(status__exact=1)
def save(self):
- if self.pk >= 167:
- md = render_images(self.body_markdown)
- else:
- md = image_url_replace(self.body_markdown)
+ if self.pk:
+ if self.pk >= 167:
+ md = render_images(self.body_markdown)
+ else:
+ md = image_url_replace(self.body_markdown)
self.body_html = markdown.markdown(md, extensions=['extra'], safe_mode=False)
self.dek == markdown.markdown(self.dek, safe_mode=False)
try: