Add to notification list on repository creation

Since commit bf7717a (git-serve.py: Adopt repositories on creation,
2015-01-06), newly created package bases are no longer orphan and
therefore, they are not adopted when pushing the first commit which also
means that the initial submitter is not added to the notification list
automatically. To remedy this, add the owner to the notification list
when setting up a new repository.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2015-01-11 00:59:09 +01:00
parent 85b48ceb12
commit cb661cd971

View file

@ -78,6 +78,10 @@ def setup_repo(repo, user):
cur.execute("INSERT INTO PackageBases (Name, SubmittedTS, ModifiedTS, " +
"SubmitterUID, MaintainerUID) VALUES (%s, UNIX_TIMESTAMP(), " +
"UNIX_TIMESTAMP(), %s, %s)", [repo, userid, userid])
pkgbase_id = cur.lastrowid
cur.execute("INSERT INTO CommentNotify (PackageBaseID, UserID) " +
"VALUES (%s, %s)", [pkgbase_id, userid])
db.commit()
db.close()