fix empty comments

This commit is contained in:
Kuroshini 2019-12-04 18:50:13 +03:00
parent 6d80678564
commit e0ad819caa

View File

@ -625,7 +625,7 @@ class Establishment(GalleryModelMixin, ProjectBaseMixin, URLImageMixin,
@property
def last_comment(self):
if hasattr(self, 'comments_prefetched'):
if hasattr(self, 'comments_prefetched') and len(self.comments_prefetched):
return self.comments_prefetched[0]