From c4714ffacc5477a510e6cb67bcc18e2cb9b89c2f Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Thu, 30 Jan 2014 14:10:45 +0530 Subject: [PATCH] Small change in the /sweets/q API --- swtr.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/swtr.py b/swtr.py index fd210b9..ca1e720 100644 --- a/swtr.py +++ b/swtr.py @@ -187,15 +187,12 @@ def searchSweets(): reponse.status_code = 400 return response - if args['where'] is None: - reponse.status_code = 400 - return response - params = {} - params['where'] = args.get('where') if args.get('who'): params['who'] = args.get('who') + if args.get('where'): + params['where'] = args.get('where') if args.get('what'): params['what'] = args.get('what') if args.get('how'): @@ -205,6 +202,7 @@ def searchSweets(): if res.count() < 1: response.status_code = 404 + response.data = 'Not Found' return response swt_list = [] -- 1.7.10.4