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':
|
elif k == 'rendered':
|
||||||
return Q(rendered=v)
|
return Q(rendered=v)
|
||||||
elif k == 'resolution':
|
elif k == 'resolution':
|
||||||
|
if isinstance(v, list) and len(v) == 2:
|
||||||
q = parseCondition({'key': 'width', 'value': v[0], 'operator': op}, user) \
|
q = parseCondition({'key': 'width', 'value': v[0], 'operator': op}, user) \
|
||||||
& parseCondition({'key': 'height', 'value': v[1], 'operator': op}, user)
|
& parseCondition({'key': 'height', 'value': v[1], 'operator': op}, user)
|
||||||
|
else:
|
||||||
|
q = Q(id=0)
|
||||||
if exclude:
|
if exclude:
|
||||||
q = ~q
|
q = ~q
|
||||||
return q
|
return q
|
||||||
|
|
Loading…
Reference in a new issue