change get image in carusel

This commit is contained in:
Dmitriy Kuzmenko 2019-11-01 18:20:48 +03:00
parent 660eb347c5
commit 0d7187e330

View File

@ -352,6 +352,8 @@ class Carousel(models.Model):
@property @property
def image_url(self): def image_url(self):
if self.attachment_suffix_url:
return f'https://s3.eu-central-1.amazonaws.com/gm-test.com/media/{self.attachment_suffix_url}'
if hasattr(self.content_object, 'image_url'): if hasattr(self.content_object, 'image_url'):
return self.content_object.image_url return self.content_object.image_url