Make notnulls set instead of list.

This commit is contained in:
voussoir 2017-09-23 11:00:37 -07:00
parent 26a034c9a0
commit 38e72c0c3a
2 changed files with 6 additions and 6 deletions

View file

@ -630,15 +630,15 @@ class PDBPhotoMixin:
searchhelpers.minmax('duration', duration, minimums, maximums, warning_bag=warning_bag)
orderby = searchhelpers.normalize_orderby(orderby)
notnulls = []
notnulls = set()
if extension or mimetype:
notnulls.append('extension')
notnulls.add('extension')
if width or height or ratio or area:
notnulls.append('width')
notnulls.add('width')
if bytes:
notnulls.append('bytes')
notnulls.add('bytes')
if duration:
notnulls.append('duration')
notnulls.add('duration')
if orderby is None:
giveback_orderby = None

View file

@ -20,7 +20,7 @@ def build_query(orderby, notnulls, minimums, maximums, mmf_results=None):
for (column, direction) in orderby:
if column != 'RANDOM()':
notnulls.append(column)
notnulls.add(column)
for column in notnulls:
wheres.append(column + ' IS NOT NULL')