summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/jrnl/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/jrnl/models.py b/app/jrnl/models.py
index 69d1178..9ceac2d 100644
--- a/app/jrnl/models.py
+++ b/app/jrnl/models.py
@@ -199,7 +199,7 @@ class Entry(models.Model):
self.featured_image.sizes.add(s)
self.featured_image.sizes.add(ss)
self.featured_image.save()
- if old.title != self.title or old.slug != self.slug:
+ if old and old.title != self.title or old and old.slug != self.slug:
related, c = RelatedPost.objects.get_or_create(model_name=self.get_content_type(), entry_id = self.id, pub_date=self.pub_date)
related.title = self.title
related.slug = self.slug