mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Merge branch 'master' into live
This commit is contained in:
commit
405c05b499
3 changed files with 8 additions and 0 deletions
|
@ -276,6 +276,9 @@ async def account_register_post(request: Request,
|
|||
args["K"] = args.get("K", str()).replace(" ", "")
|
||||
K = args.get("K")
|
||||
|
||||
# Force "H" into a boolean.
|
||||
args["H"] = H = (args.get("H", str()) == "on")
|
||||
|
||||
context = make_account_form_context(context, request, None, args)
|
||||
ok, errors = process_account_form(request, request.user, args)
|
||||
if not ok:
|
||||
|
|
|
@ -145,11 +145,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()
|
||||
|
||||
return RedirectResponse(f"/pkgbase/{name}",
|
||||
status_code=HTTPStatus.SEE_OTHER)
|
||||
|
|
|
@ -836,6 +836,9 @@ def test_pkgbase_flag(client: TestClient, user: User, maintainer: User,
|
|||
assert pkgbase.Flagger == user
|
||||
assert pkgbase.FlaggerComment == "Test"
|
||||
|
||||
# Should've gotten a FlagNotification.
|
||||
assert Email.count() == 1
|
||||
|
||||
# Now, let's check the /pkgbase/{name}/flag-comment route.
|
||||
flag_comment_endpoint = f"/pkgbase/{pkgbase.Name}/flag-comment"
|
||||
with client as request:
|
||||
|
|
Loading…
Add table
Reference in a new issue