aboutsummaryrefslogtreecommitdiff
path: root/app/utils.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-07-11 00:53:03 +0100
committerrubenwardy <rw@rubenwardy.com>2020-07-11 00:53:03 +0100
commit5f7be4b4337358e35c9eda4b261260a08a958b4a (patch)
tree1a24fe62c3ba28d1867fb6a3fbbd475f8b6a2aba /app/utils.py
parent9bf20df941deb666c0452cb425cf337d425dc59d (diff)
downloadcheatdb-5f7be4b4337358e35c9eda4b261260a08a958b4a.tar.xz
Add package and created_at to Notifications
Diffstat (limited to 'app/utils.py')
-rw-r--r--app/utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/utils.py b/app/utils.py
index 618a4aa..5f47f75 100644
--- a/app/utils.py
+++ b/app/utils.py
@@ -189,18 +189,18 @@ def is_package_page(f):
return decorated_function
-def addNotification(target, causer, title, url):
+def addNotification(target, causer, title, url, package=None):
try:
iter(target)
for x in target:
- addNotification(x, causer, title, url)
+ addNotification(x, causer, title, url, package)
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()
- notif = Notification(target, causer, title, url)
+ Notification.query.filter_by(user=target, causer=causer, title=title, url=url, package=package).delete()
+ notif = Notification(target, causer, title, url, package)
db.session.add(notif)