try to fix performance issues
(cherry picked from commit 964ead1)
This commit is contained in:
parent
0b261330e6
commit
127d15b181
|
|
@ -65,7 +65,8 @@ class CollectionEstablishmentListView(CollectionListView):
|
|||
# May raise a permission denied
|
||||
self.check_object_permissions(self.request, collection)
|
||||
|
||||
return collection.establishments.published().annotate_in_favorites(self.request.user)
|
||||
return collection.establishments.published().annotate_in_favorites(self.request.user) \
|
||||
.with_base_related().with_extended_related()
|
||||
|
||||
|
||||
# Guide
|
||||
|
|
|
|||
|
|
@ -775,8 +775,9 @@ class Establishment(GalleryMixin, ProjectBaseMixin, URLImageMixin,
|
|||
@property
|
||||
def main_image(self):
|
||||
qs = self.establishment_gallery.main_image()
|
||||
if qs.exists():
|
||||
return qs.first().image
|
||||
image_model = qs.first()
|
||||
if image_model is not None:
|
||||
return image_model.image
|
||||
|
||||
@property
|
||||
def restaurant_category_indexing(self):
|
||||
|
|
|
|||
|
|
@ -536,3 +536,5 @@ COOKIE_DOMAIN = None
|
|||
|
||||
ELASTICSEARCH_DSL = {}
|
||||
ELASTICSEARCH_INDEX_NAMES = {}
|
||||
|
||||
THUMBNAIL_FORCE_OVERWRITE = True
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user