From eb15170059c249d545dbc34bb3d00aa391ecfe76 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 6 Jul 2023 10:34:44 +0530 Subject: [PATCH] don't fail for invalid resolution requests --- pandora/item/managers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandora/item/managers.py b/pandora/item/managers.py index e0bff833c..6160f140c 100644 --- a/pandora/item/managers.py +++ b/pandora/item/managers.py @@ -86,8 +86,11 @@ def parseCondition(condition, user, owner=None): elif k == 'rendered': return Q(rendered=v) elif k == 'resolution': - q = parseCondition({'key': 'width', 'value': v[0], 'operator': op}, user) \ - & parseCondition({'key': 'height', 'value': v[1], 'operator': op}, user) + if isinstance(v, list) and len(v) == 2: + q = parseCondition({'key': 'width', 'value': v[0], 'operator': op}, user) \ + & parseCondition({'key': 'height', 'value': v[1], 'operator': op}, user) + else: + q = Q(id=0) if exclude: q = ~q return q