mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Send out-of-date notifications to co-maintainers
Currently, only package maintainers receive out-of-date notifications for their packages. Add package base co-maintainers to the list of recipients for out-of-date notifications. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
d987d756b0
commit
e9ac4b9b9e
1 changed files with 9 additions and 6 deletions
|
@ -73,12 +73,15 @@ def get_user_email(conn, uid):
|
|||
return cur.fetchone()[0]
|
||||
|
||||
|
||||
def get_maintainer_email(conn, pkgbase_id):
|
||||
cur = conn.execute('SELECT Users.Email FROM Users ' +
|
||||
def get_flag_recipients(conn, pkgbase_id):
|
||||
cur = conn.execute('SELECT DISTINCT Users.Email FROM Users ' +
|
||||
'LEFT JOIN PackageComaintainers ' +
|
||||
'ON PackageComaintainers.UsersID = Users.ID ' +
|
||||
'INNER JOIN PackageBases ' +
|
||||
'ON PackageBases.MaintainerUID = Users.ID WHERE ' +
|
||||
'PackageBases.ID = ?', [pkgbase_id])
|
||||
return cur.fetchone()[0]
|
||||
'ON PackageBases.MaintainerUID = Users.ID OR ' +
|
||||
'PackageBases.ID = PackageComaintainers.PackageBaseID ' +
|
||||
'WHERE PackageBases.ID = ?', [pkgbase_id])
|
||||
return [row[0] for row in cur.fetchall()]
|
||||
|
||||
|
||||
def get_recipients(conn, pkgbase_id, uid):
|
||||
|
@ -247,7 +250,7 @@ def update(conn, uid, pkgbase_id):
|
|||
def flag(conn, uid, pkgbase_id):
|
||||
user = username_from_id(conn, uid)
|
||||
pkgbase = pkgbase_from_id(conn, pkgbase_id)
|
||||
to = [get_maintainer_email(conn, pkgbase_id)]
|
||||
to = get_flag_recipients(conn, pkgbase_id)
|
||||
text = get_flagger_comment(conn, pkgbase_id)
|
||||
|
||||
user_uri = aur_location + '/account/' + user + '/'
|
||||
|
|
Loading…
Add table
Reference in a new issue