forked from 0x2620/pandora
don't fail for invalid resolution requests
This commit is contained in:
parent
a2c2e32bfe
commit
eb15170059
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue