Code cleanups

This commit is contained in:
Roberto Rosario
2014-06-29 20:35:36 -04:00
parent 1d821a488f
commit 41d0cfb7bf
15 changed files with 31 additions and 64 deletions

View File

@@ -110,12 +110,12 @@ def perform_search(query_string, field_list=None):
single_result_ids = set(model.objects.filter(query).values_list('pk', flat=True))
#Convert queryset to python set and perform the
#AND operation on the program and not as a query
if model_result_ids == None:
if not model_result_ids:
model_result_ids = single_result_ids
else:
model_result_ids &= single_result_ids
if model_result_ids == None:
if not model_result_ids:
model_result_ids = []
result_count += len(model_result_ids)