Skip to content

Commit

Permalink
quote deploy bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kagrawal2 committed Dec 29, 2016
1 parent 7316291 commit 80045d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/quoteManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ 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.readall().decode('utf-8'))
print(retrieved_data)
return Quote(data=retrieved_data)
except:
return None
else:
print('response returned none')
return None

# f = Forismatic()
Expand Down
2 changes: 1 addition & 1 deletion app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def suggestQuote(title, description, count=0):
print('returning quote')
return { 'q' : quote.quote, 'author' : quote.author }
else:
if count < 10:
if count < 4:
count += 1
return suggestQuote(title, description, count)
else:
Expand Down

0 comments on commit 80045d9

Please sign in to comment.