dont include null values in lookup
This commit is contained in:
parent
484b33e39d
commit
2a63a3b300
1 changed files with 3 additions and 1 deletions
|
@ -714,7 +714,9 @@ def lookup(request, data):
|
||||||
if i:
|
if i:
|
||||||
r = {'id': i.public_id}
|
r = {'id': i.public_id}
|
||||||
for key in ('title', 'director', 'year'):
|
for key in ('title', 'director', 'year'):
|
||||||
r[key] = i.get(key)
|
value = i.get(key)
|
||||||
|
if value != None:
|
||||||
|
r[key] = value
|
||||||
response = json_response(r)
|
response = json_response(r)
|
||||||
else:
|
else:
|
||||||
response = json_response(status=404, text='not found')
|
response = json_response(status=404, text='not found')
|
||||||
|
|
Loading…
Reference in a new issue