From e0ad819caa943a2731d5ef788d0ca220a2419823 Mon Sep 17 00:00:00 2001 From: Kuroshini Date: Wed, 4 Dec 2019 18:50:13 +0300 Subject: [PATCH] fix empty comments --- apps/establishment/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/establishment/models.py b/apps/establishment/models.py index 6c9080f0..c598de55 100644 --- a/apps/establishment/models.py +++ b/apps/establishment/models.py @@ -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]