diff options
Diffstat (limited to 'git-interface')
-rwxr-xr-x | git-interface/git-update.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/git-interface/git-update.py b/git-interface/git-update.py index 215848e..958fa7a 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() |