fix findPlace performance

This commit is contained in:
j 2019-08-01 15:36:06 +02:00
parent 9596248dc4
commit 02a2d00f9d
2 changed files with 1 additions and 1 deletions

View file

@ -141,4 +141,5 @@ class PlaceManager(Manager):
user)
if conditions:
qs = qs.filter(conditions)
qs = qs.distinct()
return qs

View file

@ -239,7 +239,6 @@ def findPlaces(request, data):
qs = order_query(query['qs'], query['sort'])
qs = qs.distinct()
if 'keys' in data:
qs = qs.select_related('user__profile')
qs = qs[query['range'][0]:query['range'][1]]
response['data']['items'] = [p.json(data['keys'], request.user) for p in qs]
elif 'position' in query: