Append range name only if not none

This commit is contained in:
PCoder 2022-03-05 01:23:08 +05:30
parent 401b554a1c
commit 2dda215ffe

View file

@ -176,7 +176,10 @@ def get_paginated(query_set, page, per_page):
for p in paginator.object_list:
filters['country'].append(p.country.short_name)
for r in p.peoplerange_set.all():
filters['range'].append(r.range.range_name)
if r.range and r.range.range_name:
filters['range'].append(r.range.range_name)
else:
print("r.range.range_name is None %s %s" % (r.range_id, r.person_id))
for r in p.fieldspeople_set.all():
filters['field'].append(r.field.name)
for r in p.taxapeople_set.all():