check that range is [int, int]
This commit is contained in:
parent
e536dcb3b0
commit
f0b8b2b81e
2 changed files with 3 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -25,3 +25,4 @@ static/django_extensions
|
||||||
*.pyc
|
*.pyc
|
||||||
*~
|
*~
|
||||||
*.swp
|
*.swp
|
||||||
|
pandora/gunicorn_config.py
|
||||||
|
|
|
@ -84,6 +84,8 @@ def parse_query(data, user):
|
||||||
for key in ('sort', 'keys', 'group', 'range', 'position', 'positions'):
|
for key in ('sort', 'keys', 'group', 'range', 'position', 'positions'):
|
||||||
if key in data:
|
if key in data:
|
||||||
query[key] = data[key]
|
query[key] = data[key]
|
||||||
|
if [r for r in query['range'] if not isinstance(r, int)]:
|
||||||
|
query['range'] = [0, 0]
|
||||||
query['qs'] = models.Item.objects.find(data, user)
|
query['qs'] = models.Item.objects.find(data, user)
|
||||||
if 'clips' in data:
|
if 'clips' in data:
|
||||||
conditions = {'query': data['clips']['query']}
|
conditions = {'query': data['clips']['query']}
|
||||||
|
|
Loading…
Reference in a new issue