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
|
# May raise a permission denied
|
||||||
self.check_object_permissions(self.request, collection)
|
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
|
# Guide
|
||||||
|
|
|
||||||
|
|
@ -775,8 +775,9 @@ class Establishment(GalleryMixin, ProjectBaseMixin, URLImageMixin,
|
||||||
@property
|
@property
|
||||||
def main_image(self):
|
def main_image(self):
|
||||||
qs = self.establishment_gallery.main_image()
|
qs = self.establishment_gallery.main_image()
|
||||||
if qs.exists():
|
image_model = qs.first()
|
||||||
return qs.first().image
|
if image_model is not None:
|
||||||
|
return image_model.image
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def restaurant_category_indexing(self):
|
def restaurant_category_indexing(self):
|
||||||
|
|
|
||||||
|
|
@ -536,3 +536,5 @@ COOKIE_DOMAIN = None
|
||||||
|
|
||||||
ELASTICSEARCH_DSL = {}
|
ELASTICSEARCH_DSL = {}
|
||||||
ELASTICSEARCH_INDEX_NAMES = {}
|
ELASTICSEARCH_INDEX_NAMES = {}
|
||||||
|
|
||||||
|
THUMBNAIL_FORCE_OVERWRITE = True
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user