fix append a None object to list
This commit is contained in:
@@ -43,10 +43,12 @@ class FetUserSearchForm(SearchForm):
|
||||
tmp_results = deque([])
|
||||
|
||||
for elem in sqs_intern.order_by("-date"):
|
||||
tmp_results.append(elem.object)
|
||||
if elem.object:
|
||||
tmp_results.append(elem.object)
|
||||
|
||||
for elem in sqs_post.order_by("-date"):
|
||||
tmp_results.append(elem.object)
|
||||
if elem.object:
|
||||
tmp_results.append(elem.object)
|
||||
|
||||
tmp_results = sorted(tmp_results, key=lambda elem: elem.date, reverse=True)
|
||||
|
||||
@@ -90,7 +92,8 @@ class NonUserSearchForm(SearchForm):
|
||||
tmp_results = deque([])
|
||||
|
||||
for elem in sqs_post.order_by("-date"):
|
||||
tmp_results.append(elem.object)
|
||||
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