fix carousel slugs

This commit is contained in:
Kuroshini 2019-12-17 18:37:51 +03:00
parent 41f6b8c930
commit f0585b3ebc

View File

@ -279,6 +279,11 @@ class Carousel(models.Model):
@property
def slug(self):
if hasattr(self.content_object, 'slugs'):
try:
return next(iter(self.content_object.slugs.values()))
except StopIteration:
return None
if hasattr(self.content_object, 'slug'):
return self.content_object.slug