Fix possible none

This commit is contained in:
PCoder 2022-03-05 01:32:47 +05:30
parent da8fba3497
commit 5b7e4eed3e
1 changed files with 1 additions and 1 deletions

View File

@ -183,7 +183,7 @@ def get_paginated(query_set, page, per_page):
for r in p.fieldspeople_set.all():
filters['field'].append(r.field.name)
for r in p.taxapeople_set.all():
if r.taxon and r.taxon.name:
if r and r.taxon and r.taxon.name:
filters['taxon'].append(r.taxon.name)
else:
print("r.taxon.name is None %s %s" % (r.range_id, r.taxon))