mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: send up to date flag notifications
These were being produced with the db state before the flag was set, which is not what should be done for flag notifications, as the notification contains data about the comment and the current flagger. Closes #292 Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
640630faff
commit
040c9bc3e6
1 changed files with 2 additions and 2 deletions
|
@ -150,13 +150,13 @@ async def pkgbase_flag_post(request: Request, name: str,
|
|||
|
||||
has_cred = request.user.has_credential(creds.PKGBASE_FLAG)
|
||||
if has_cred and not pkgbase.OutOfDateTS:
|
||||
notif = notify.FlagNotification(request.user.ID, pkgbase.ID)
|
||||
now = time.utcnow()
|
||||
with db.begin():
|
||||
pkgbase.OutOfDateTS = now
|
||||
pkgbase.Flagger = request.user
|
||||
pkgbase.FlaggerComment = comments
|
||||
notif.send()
|
||||
|
||||
notify.FlagNotification(request.user.ID, pkgbase.ID).send()
|
||||
|
||||
return RedirectResponse(f"/pkgbase/{name}",
|
||||
status_code=HTTPStatus.SEE_OTHER)
|
||||
|
|
Loading…
Add table
Reference in a new issue