aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-07-09 05:54:39 +0100
committerrubenwardy <rw@rubenwardy.com>2020-07-09 05:54:39 +0100
commit000259fc8875e8577500d4e60ba3c5b5898f56d8 (patch)
tree5def9c8e5093677fc6b321c28d0e17012053efaa
parent078765fe44de4b923f008595eafc8d16cb8c99f1 (diff)
downloadcheatdb-000259fc8875e8577500d4e60ba3c5b5898f56d8.tar.xz
Fix crash on sending notification
-rw-r--r--app/utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/utils.py b/app/utils.py
index 3478f4a..07337b6 100644
--- a/app/utils.py
+++ b/app/utils.py
@@ -22,7 +22,6 @@ from .models import *
from . import app
import random, string, os, imghdr
from urllib.parse import urljoin
-from collections.abc import Iterable
def abs_url_for(path, **kwargs):
scheme = "https" if app.config["BASE_URL"][:5] == "https" else "http"
@@ -191,10 +190,13 @@ def is_package_page(f):
def addNotification(target, causer, title, url):
- if isinstance(target, Iterable):
+ try:
+ iter(target)
for x in target:
addNotification(x, causer, title, url)
return
+ except TypeError:
+ pass
if target.rank.atLeast(UserRank.NEW_MEMBER) and target != causer:
Notification.query.filter_by(user=target, causer=causer, title=title, url=url).delete()