mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
notify: Avoid EXCEPT in SQL statement
Do not use the EXCEPT clause which is unsupported in MySQL. Instead, use a subquery which is standard-compliant and makes the query easier to read at the same time. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
9dd0d92d61
commit
fd36125a21
1 changed files with 4 additions and 6 deletions
|
@ -139,12 +139,10 @@ def get_request_recipients(conn, reqid):
|
||||||
|
|
||||||
|
|
||||||
def get_tu_vote_reminder_recipients(conn, vote_id):
|
def get_tu_vote_reminder_recipients(conn, vote_id):
|
||||||
cur = conn.execute('SELECT Users.Email FROM Users ' +
|
cur = conn.execute('SELECT Email FROM Users ' +
|
||||||
'WHERE AccountTypeID = 2 ' +
|
'WHERE AccountTypeID = 2 AND ID NOT IN ' +
|
||||||
'EXCEPT SELECT Users.Email FROM Users ' +
|
'(SELECT UserID FROM TU_Votes ' +
|
||||||
'INNER JOIN TU_Votes ' +
|
'WHERE TU_Votes.VoteID = ?)', [vote_id])
|
||||||
'ON TU_Votes.UserID = Users.ID ' +
|
|
||||||
'WHERE TU_Votes.VoteID = ?', [vote_id])
|
|
||||||
return [row[0] for row in cur.fetchall()]
|
return [row[0] for row in cur.fetchall()]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue