mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
git-update: Avoid duplicate notifications
Fixes FS#45254. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
8aa4c51dfb
commit
c7ff97a6a8
1 changed files with 6 additions and 2 deletions
|
@ -144,6 +144,10 @@ def save_srcinfo(srcinfo, db, cur, user):
|
||||||
|
|
||||||
# Add user to notification list on adoption.
|
# Add user to notification list on adoption.
|
||||||
if was_orphan:
|
if was_orphan:
|
||||||
|
cur.execute("SELECT COUNT(*) FROM CommentNotify WHERE " +
|
||||||
|
"PackageBaseID = %s AND UserID = %s",
|
||||||
|
[pkgbase_id, user_id])
|
||||||
|
if cur.fetchone()[0] == 0:
|
||||||
cur.execute("INSERT INTO CommentNotify (PackageBaseID, UserID) " +
|
cur.execute("INSERT INTO CommentNotify (PackageBaseID, UserID) " +
|
||||||
"VALUES (%s, %s)", [pkgbase_id, user_id])
|
"VALUES (%s, %s)", [pkgbase_id, user_id])
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue