summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/jrnl/models.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/jrnl/models.py b/app/jrnl/models.py
index 6f9d7a6..174b391 100644
--- a/app/jrnl/models.py
+++ b/app/jrnl/models.py
@@ -116,8 +116,11 @@ class Entry(models.Model):
return '%spost-thumbnail/%s/%s' % (settings.IMAGES_URL, image_dir, img)
def get_image_url(self):
- image_dir, img = self.image.url.split('post-images/')[1].split('/')
- return '%spost-images/%s/%s' % (settings.IMAGES_URL, image_dir, img)
+ try:
+ image_dir, img = self.image.url.split('post-images/')[1].split('/')
+ return '%spost-images/%s/%s' % (settings.IMAGES_URL, image_dir, img)
+ except ValueError:
+ pass
def get_image_wide_url(self):
img = self.image.url.split('post-images/')[1].split('/')[1]