summaryrefslogtreecommitdiffstats
path: root/aurweb/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'aurweb/scripts')
-rwxr-xr-xaurweb/scripts/notify.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/aurweb/scripts/notify.py b/aurweb/scripts/notify.py
index edae76f8..7f8e7168 100755
--- a/aurweb/scripts/notify.py
+++ b/aurweb/scripts/notify.py
@@ -126,7 +126,7 @@ class ResetKeyNotification(Notification):
def __init__(self, conn, uid):
cur = conn.execute('SELECT UserName, Email, BackupEmail, ' +
'LangPreference, ResetKey ' +
- 'FROM Users WHERE ID = ?', [uid])
+ 'FROM Users WHERE ID = ? AND Suspended = 0', [uid])
self._username, self._to, self._backup, self._lang, self._resetkey = cur.fetchone()
super().__init__()
@@ -173,7 +173,8 @@ class CommentNotification(Notification):
'ON PackageNotifications.UserID = Users.ID WHERE ' +
'Users.CommentNotify = 1 AND ' +
'PackageNotifications.UserID != ? AND ' +
- 'PackageNotifications.PackageBaseID = ?',
+ 'PackageNotifications.PackageBaseID = ? AND ' +
+ 'Users.Suspended = 0',
[uid, pkgbase_id])
self._recipients = cur.fetchall()
cur = conn.execute('SELECT Comments FROM PackageComments WHERE ID = ?',
@@ -220,7 +221,8 @@ class UpdateNotification(Notification):
'ON PackageNotifications.UserID = Users.ID WHERE ' +
'Users.UpdateNotify = 1 AND ' +
'PackageNotifications.UserID != ? AND ' +
- 'PackageNotifications.PackageBaseID = ?',
+ 'PackageNotifications.PackageBaseID = ? AND ' +
+ 'Users.Suspended = 0',
[uid, pkgbase_id])
self._recipients = cur.fetchall()
super().__init__()
@@ -266,7 +268,8 @@ class FlagNotification(Notification):
'INNER JOIN PackageBases ' +
'ON PackageBases.MaintainerUID = Users.ID OR ' +
'PackageBases.ID = PackageComaintainers.PackageBaseID ' +
- 'WHERE PackageBases.ID = ?', [pkgbase_id])
+ 'WHERE PackageBases.ID = ? AND ' +
+ 'Users.Suspended = 0', [pkgbase_id])
self._recipients = cur.fetchall()
cur = conn.execute('SELECT FlaggerComment FROM PackageBases WHERE ' +
'ID = ?', [pkgbase_id])
@@ -304,7 +307,8 @@ class OwnershipEventNotification(Notification):
'ON PackageNotifications.UserID = Users.ID WHERE ' +
'Users.OwnershipNotify = 1 AND ' +
'PackageNotifications.UserID != ? AND ' +
- 'PackageNotifications.PackageBaseID = ?',
+ 'PackageNotifications.PackageBaseID = ? AND ' +
+ 'Users.Suspended = 0',
[uid, pkgbase_id])
self._recipients = cur.fetchall()
cur = conn.execute('SELECT FlaggerComment FROM PackageBases WHERE ' +
@@ -343,7 +347,7 @@ class ComaintainershipEventNotification(Notification):
def __init__(self, conn, uid, pkgbase_id):
self._pkgbase = pkgbase_from_id(conn, pkgbase_id)
cur = conn.execute('SELECT Email, LangPreference FROM Users ' +
- 'WHERE ID = ?', [uid])
+ 'WHERE ID = ? AND Suspended = 0', [uid])
self._to, self._lang = cur.fetchone()
super().__init__()
@@ -386,7 +390,8 @@ class DeleteNotification(Notification):
'INNER JOIN PackageNotifications ' +
'ON PackageNotifications.UserID = Users.ID WHERE ' +
'PackageNotifications.UserID != ? AND ' +
- 'PackageNotifications.PackageBaseID = ?',
+ 'PackageNotifications.PackageBaseID = ? AND ' +
+ 'Users.Suspended = 0',
[uid, old_pkgbase_id])
self._recipients = cur.fetchall()
super().__init__()
@@ -433,7 +438,8 @@ class RequestOpenNotification(Notification):
'INNER JOIN Users ' +
'ON Users.ID = PackageRequests.UsersID ' +
'OR Users.ID = PackageBases.MaintainerUID ' +
- 'WHERE PackageRequests.ID = ?', [reqid])
+ 'WHERE PackageRequests.ID = ? AND ' +
+ 'Users.Suspended = 0', [reqid])
self._to = aurweb.config.get('options', 'aur_request_ml')
self._cc = [row[0] for row in cur.fetchall()]
cur = conn.execute('SELECT Comments FROM PackageRequests WHERE ID = ?',
@@ -489,7 +495,8 @@ class RequestCloseNotification(Notification):
'INNER JOIN Users ' +
'ON Users.ID = PackageRequests.UsersID ' +
'OR Users.ID = PackageBases.MaintainerUID ' +
- 'WHERE PackageRequests.ID = ?', [reqid])
+ 'WHERE PackageRequests.ID = ? AND ' +
+ 'Users.Suspended = 0', [reqid])
self._to = aurweb.config.get('options', 'aur_request_ml')
self._cc = [row[0] for row in cur.fetchall()]
cur = conn.execute('SELECT PackageRequests.ClosureComment, ' +
@@ -547,7 +554,8 @@ class TUVoteReminderNotification(Notification):
cur = conn.execute('SELECT Email, LangPreference FROM Users ' +
'WHERE AccountTypeID IN (2, 4) AND ID NOT IN ' +
'(SELECT UserID FROM TU_Votes ' +
- 'WHERE TU_Votes.VoteID = ?)', [vote_id])
+ 'WHERE TU_Votes.VoteID = ?) AND ' +
+ 'Users.Suspended = 0', [vote_id])
self._recipients = cur.fetchall()
super().__init__()