mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: add comments in email for direct deletion/merge
TUs and Devs can delete and merge packages directly. Currently the comments they enter, don't end up in the ML notification. Include the comment in the notifications for direct deletion / merge Signed-off-by: moson-mo <mo-son@mailbox.org>
This commit is contained in:
parent
7d1827ffc5
commit
b9df7541b3
3 changed files with 60 additions and 4 deletions
|
@ -153,7 +153,11 @@ def close_pkgreq(
|
|||
|
||||
@db.retry_deadlock
|
||||
def handle_request(
|
||||
request: Request, reqtype_id: int, pkgbase: PackageBase, target: PackageBase = None
|
||||
request: Request,
|
||||
reqtype_id: int,
|
||||
pkgbase: PackageBase,
|
||||
target: PackageBase = None,
|
||||
comments: str = str(),
|
||||
) -> list[notify.Notification]:
|
||||
"""
|
||||
Handle package requests before performing an action.
|
||||
|
@ -228,7 +232,7 @@ def handle_request(
|
|||
PackageBase=pkgbase,
|
||||
PackageBaseName=pkgbase.Name,
|
||||
Comments="Autogenerated by aurweb.",
|
||||
ClosureComment=str(),
|
||||
ClosureComment=comments,
|
||||
)
|
||||
|
||||
# If it's a merge request, set MergeBaseName to `target`.Name.
|
||||
|
|
|
@ -133,7 +133,7 @@ def pkgbase_delete_instance(
|
|||
request: Request, pkgbase: PackageBase, comments: str = str()
|
||||
) -> list[notify.Notification]:
|
||||
notif = notify.DeleteNotification(request.user.ID, pkgbase.ID)
|
||||
notifs = handle_request(request, DELETION_ID, pkgbase) + [notif]
|
||||
notifs = handle_request(request, DELETION_ID, pkgbase, comments=comments) + [notif]
|
||||
|
||||
_retry_delete(pkgbase, comments)
|
||||
|
||||
|
@ -181,7 +181,7 @@ def pkgbase_merge_instance(
|
|||
pkgbasename = str(pkgbase.Name)
|
||||
|
||||
# Create notifications.
|
||||
notifs = handle_request(request, MERGE_ID, pkgbase, target)
|
||||
notifs = handle_request(request, MERGE_ID, pkgbase, target, comments)
|
||||
|
||||
_retry_merge(pkgbase, target)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue