change(notify): converted to use aurweb.db ORM

- Removed notify sharness test

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-22 12:03:53 -08:00
parent 9fb1fbe32c
commit d8e3ca1abb
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
7 changed files with 934 additions and 627 deletions

View file

@ -239,7 +239,6 @@ def remove_comaintainers(pkgbase: models.PackageBase,
:param usernames: Iterable of username strings
:return: None
"""
conn = db.ConnectionExecutor(db.get_engine().raw_connection())
notifications = []
with db.begin():
for username in usernames:
@ -250,8 +249,7 @@ def remove_comaintainers(pkgbase: models.PackageBase,
).first()
notifications.append(
notify.ComaintainerRemoveNotification(
conn, comaintainer.User.ID, pkgbase.ID
)
comaintainer.User.ID, pkgbase.ID)
)
db.delete(comaintainer)
@ -283,7 +281,6 @@ def add_comaintainers(request: Request, pkgbase: models.PackageBase,
memo[username] = user
# Alright, now that we got past the check, add them all to the DB.
conn = db.ConnectionExecutor(db.get_engine().raw_connection())
notifications = []
with db.begin():
for username in usernames:
@ -302,7 +299,7 @@ def add_comaintainers(request: Request, pkgbase: models.PackageBase,
notifications.append(
notify.ComaintainerAddNotification(
conn, comaintainer.User.ID, pkgbase.ID)
comaintainer.User.ID, pkgbase.ID)
)
# Send out notifications.