summaryrefslogtreecommitdiffstats
path: root/git-interface
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-06-08 21:52:59 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-06-08 21:52:59 +0200
commitc7ff97a6a86c2dd315d09656af568a108ada3567 (patch)
treec4987b17d1e02b8180b36e121fbf8b12feb89046 /git-interface
parent8aa4c51dfb0baab7204f13da23618569dc1c7162 (diff)
downloadaur-c7ff97a6a86c2dd315d09656af568a108ada3567.tar.gz
aur-c7ff97a6a86c2dd315d09656af568a108ada3567.tar.xz
git-update: Avoid duplicate notifications
Fixes FS#45254. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'git-interface')
-rwxr-xr-xgit-interface/git-update.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-interface/git-update.py b/git-interface/git-update.py
index 215848e0..958fa7a3 100755
--- a/git-interface/git-update.py
+++ b/git-interface/git-update.py
@@ -144,8 +144,12 @@ def save_srcinfo(srcinfo, db, cur, user):
# Add user to notification list on adoption.
if was_orphan:
- cur.execute("INSERT INTO CommentNotify (PackageBaseID, UserID) " +
- "VALUES (%s, %s)", [pkgbase_id, user_id])
+ 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) " +
+ "VALUES (%s, %s)", [pkgbase_id, user_id])
db.commit()