From 5ee6062cad0c37a3fe45980eaab9d816bf0884ae Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 23 Mar 2017 15:17:19 -0700 Subject: [PATCH] Use None check instead of general falsey for minmax --- etiquette/photodb.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 2e2c58d..a64bebb 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -825,14 +825,16 @@ class PDBPhotoMixin: continue if any( - not fetch[constants.SQL_PHOTO[key]] or fetch[constants.SQL_PHOTO[key]] > value + fetch[constants.SQL_PHOTO[key]] is None or + fetch[constants.SQL_PHOTO[key]] > value for (key, value) in maximums.items() ): #print('Failed maximums') continue if any( - not fetch[constants.SQL_PHOTO[key]] or fetch[constants.SQL_PHOTO[key]] < value + fetch[constants.SQL_PHOTO[key]] is None or + fetch[constants.SQL_PHOTO[key]] < value for (key, value) in minimums.items() ): #print('Failed minimums')