From 2a63a3b300541c83133a40e152018352da03bc06 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 16 Feb 2015 16:12:44 +0000 Subject: [PATCH] dont include null values in lookup --- pandora/item/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index accb2513..d7451adc 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -714,7 +714,9 @@ def lookup(request, data): if i: r = {'id': i.public_id} 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) else: response = json_response(status=404, text='not found')