From 286e3b2363b5e4cf9b6ba050e8db740e2af003d2 Mon Sep 17 00:00:00 2001 From: Kireet Agrawal Date: Thu, 29 Dec 2016 10:54:31 -0500 Subject: [PATCH] quote deploy bug --- app/quoteManager.py | 2 -- app/views.py | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/quoteManager.py b/app/quoteManager.py index 41a79ca..ffacdd4 100644 --- a/app/quoteManager.py +++ b/app/quoteManager.py @@ -93,9 +93,7 @@ def get_quote(self, lang='en', key=None): # Decoding JSON and fill Quote, if HTTP responce is OK # try: - print('data was received') retrieved_data = json.loads(response.read().decode('utf-8')) - print(retrieved_data) return Quote(data=retrieved_data) # except: # return None diff --git a/app/views.py b/app/views.py index 36178f7..1f7a4bc 100644 --- a/app/views.py +++ b/app/views.py @@ -39,13 +39,9 @@ def suggestQuote(title, description, count=0): """ Using a quotes database, relationship between title, description : quote and author """ - print(f) + quote = f.get_quote() - print('here') - if quote is not None: - print('quote found') - if len(quote.quote + quote.author) < 201: - print('returning quote') + if quote is not None and len(quote.quote + quote.author) < 201: return { 'q' : quote.quote, 'author' : quote.author } else: if count < 4: