From 2dadf6ee56e25324dddc84a65b1c34c1c8295b6d Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 17 Aug 2017 01:02:21 -0500 Subject: [PATCH] moar bugfix correct indent for response, adds response for parse incorrect tag url --- app/wallpaper.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/wallpaper.py b/app/wallpaper.py index 865c8e17..cf01ce51 100644 --- a/app/wallpaper.py +++ b/app/wallpaper.py @@ -10,15 +10,17 @@ def get_wall(message): # Add those comma separated strings onto the end of the URL variable url = unsplash_url + joined_terms - print(url) elif len(message.split()) > 1: term = message.split()[1] url = unsplash_url + term - print(url) else: url = unsplash_url - print(url) - return requests.get(url).url + response = requests.get(url).url + + if 'photo-1446704477871-62a4972035cd' in response: + return "Could not find and image for those tags." + else: + return response