fix: include maint/comaint state in pkgbase post's error context

Closes #386

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-09-02 15:04:43 -07:00
parent 8a3a7e31ac
commit b8a4ce4ceb
No known key found for this signature in database
GPG key ID: F7E46DED420788F3

View file

@ -587,6 +587,9 @@ async def pkgbase_disown_post(
context = templates.make_context(request, "Disown Package")
context["pkgbase"] = pkgbase
context["is_maint"] = request.user == pkgbase.Maintainer
context["is_comaint"] = request.user in comaints
if not confirm:
context["errors"] = [
(
@ -610,9 +613,7 @@ async def pkgbase_disown_post(
request, "pkgbase/disown.html", context, status_code=HTTPStatus.BAD_REQUEST
)
if not next:
next = f"/pkgbase/{name}"
next = next or f"/pkgbase/{name}"
return RedirectResponse(next, status_code=HTTPStatus.SEE_OTHER)