fix(FastAPI): maintainers are allowed to unflag their packages

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-10-15 15:11:45 -07:00
parent 81c9312606
commit 71b3f781f7
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
2 changed files with 27 additions and 5 deletions

View file

@ -820,7 +820,7 @@ async def pkgbase_unflag(request: Request, name: str):
pkgbase = get_pkg_or_base(name, PackageBase)
has_cred = request.user.has_credential(
"CRED_PKGBASE_UNFLAG", approved=[pkgbase.Flagger])
"CRED_PKGBASE_UNFLAG", approved=[pkgbase.Flagger, pkgbase.Maintainer])
if has_cred:
with db.begin():
pkgbase.OutOfDateTS = None