#11013: filter persons only with profile_on_web true for public search
This commit is contained in:
parent
db54e3c3d7
commit
30f0743c41
1 changed files with 2 additions and 2 deletions
|
@ -213,10 +213,10 @@ class SearchView(View):
|
||||||
per_page = int(self.request.GET.get('per_page', 10))
|
per_page = int(self.request.GET.get('per_page', 10))
|
||||||
q = self.request.GET.get('q', '').strip()
|
q = self.request.GET.get('q', '').strip()
|
||||||
if not q or len(q) < 3:
|
if not q or len(q) < 3:
|
||||||
query_set = Person.objects.all()
|
query_set = Person.objects.filter(profile_on_web=True).all()
|
||||||
else:
|
else:
|
||||||
query = reduce(operator.or_, (Q(field_indexer__icontains=item) for item in q.split(" ")))
|
query = reduce(operator.or_, (Q(field_indexer__icontains=item) for item in q.split(" ")))
|
||||||
query_set = Person.objects.filter(query)
|
query_set = Person.objects.filter(query).filter(profile_on_web=True)
|
||||||
|
|
||||||
q_country = self.request.GET.get('country', '')
|
q_country = self.request.GET.get('country', '')
|
||||||
q_range = self.request.GET.get('range', '')
|
q_range = self.request.GET.get('range', '')
|
||||||
|
|
Loading…
Reference in a new issue