aboutsummaryrefslogtreecommitdiffstats
path: root/services.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2021-03-11 00:31:08 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2021-03-11 00:31:08 +0000
commitf67cf22b71ae7eddb7952ce315825ecb95af2c29 (patch)
treef7e07b29c47b3f4f1a80de4a141f6afed0c1a27f /services.py
parent25789243a832c60524bb28c815f48914697a3506 (diff)
downloadeda.gay-f67cf22b71ae7eddb7952ce315825ecb95af2c29.tar.gz
eda.gay-f67cf22b71ae7eddb7952ce315825ecb95af2c29.zip
fixed bug where it threw an error when it couldnt get an image
Diffstat (limited to 'services.py')
-rw-r--r--services.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/services.py b/services.py
index 8531c6b..d2ae979 100644
--- a/services.py
+++ b/services.py
@@ -169,7 +169,8 @@ def get_random_image(tags):
try:
element = random.choice(imageElements)
except IndexError:
- raise ConnectionError("Couldn't find any images")
+ # raise ConnectionError("Couldn't find any images")
+ return get_random_image(tags)
url = "https://safebooru.org/" + element.get("href")
if get_id_from_url(url) == theLastId: