fix append a None object to list
This commit is contained in:
@@ -43,9 +43,11 @@ class FetUserSearchForm(SearchForm):
|
||||
tmp_results = deque([])
|
||||
|
||||
for elem in sqs_intern.order_by("-date"):
|
||||
if elem.object:
|
||||
tmp_results.append(elem.object)
|
||||
|
||||
for elem in sqs_post.order_by("-date"):
|
||||
if elem.object:
|
||||
tmp_results.append(elem.object)
|
||||
|
||||
tmp_results = sorted(tmp_results, key=lambda elem: elem.date, reverse=True)
|
||||
@@ -90,6 +92,7 @@ class NonUserSearchForm(SearchForm):
|
||||
tmp_results = deque([])
|
||||
|
||||
for elem in sqs_post.order_by("-date"):
|
||||
if elem.object:
|
||||
tmp_results.append(elem.object)
|
||||
|
||||
tmp_results = sorted(tmp_results, key=lambda elem: elem.date, reverse=True)
|
||||
|
||||
Reference in New Issue
Block a user