check photo not url

This commit is contained in:
j 2018-02-22 19:19:05 +05:30
parent 7cd8136260
commit e65bd99f31

View File

@ -125,7 +125,7 @@ class Content(models.Model):
@property @property
def image_url(self): def image_url(self):
if self.photo.image.url: if self.photo:
return self.photo.image.url return self.photo.image.url
if self.image: if self.image:
if self.image.startswith('http') or self.image.startswith('/'): if self.image.startswith('http') or self.image.startswith('/'):