Fix finding range from name

This commit is contained in:
PCoder 2022-03-05 02:09:38 +05:30
parent 5b7e4eed3e
commit f272481bf6

View file

@ -225,7 +225,7 @@ class SearchView(View):
if len(q_country) > 2: if len(q_country) > 2:
query_set = query_set.filter(country__short_name__icontains=q_country.strip().lower()) query_set = query_set.filter(country__short_name__icontains=q_country.strip().lower())
if len(q_range) > 2: if len(q_range) > 2:
ranges_people = PeopleRange.objects.filter(range__name__icontains=q_range.strip().lower()) ranges_people = PeopleRange.objects.filter(range__range_name__icontains=q_range.strip().lower())
r_people_ids = [rp.person_id for rp in ranges_people] r_people_ids = [rp.person_id for rp in ranges_people]
query_set = query_set.filter(id__in=r_people_ids) query_set = query_set.filter(id__in=r_people_ids)
if len(q_field) > 2: if len(q_field) > 2: