summaryrefslogtreecommitdiff
path: root/app/jrnl/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/jrnl/models.py')
-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: