mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(python): fix difference parsing of comaintainers
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
918593c3e6
commit
02a62532da
1 changed files with 3 additions and 2 deletions
|
@ -512,10 +512,10 @@ async def package_base_comaintainers_post(
|
||||||
return RedirectResponse(f"/pkgbase/{name}",
|
return RedirectResponse(f"/pkgbase/{name}",
|
||||||
status_code=HTTPStatus.SEE_OTHER)
|
status_code=HTTPStatus.SEE_OTHER)
|
||||||
|
|
||||||
users = set(users.split("\n"))
|
users = {e.strip() for e in users.split("\n") if bool(e.strip())}
|
||||||
users.remove(str()) # Remove any empty strings from the set.
|
|
||||||
records = {c.User.Username for c in pkgbase.comaintainers}
|
records = {c.User.Username for c in pkgbase.comaintainers}
|
||||||
|
|
||||||
|
logger.debug(f"RemoveComaintainers: {records.difference(users)}")
|
||||||
pkgutil.remove_comaintainers(pkgbase, records.difference(users))
|
pkgutil.remove_comaintainers(pkgbase, records.difference(users))
|
||||||
|
|
||||||
# Default priority (lowest value; most preferred).
|
# Default priority (lowest value; most preferred).
|
||||||
|
@ -533,6 +533,7 @@ async def package_base_comaintainers_post(
|
||||||
if last_priority:
|
if last_priority:
|
||||||
priority = last_priority.Priority + 1
|
priority = last_priority.Priority + 1
|
||||||
|
|
||||||
|
logger.debug(f"AddComaintainers: {users.difference(records)}")
|
||||||
error = pkgutil.add_comaintainers(request, pkgbase, priority,
|
error = pkgutil.add_comaintainers(request, pkgbase, priority,
|
||||||
users.difference(records))
|
users.difference(records))
|
||||||
if error:
|
if error:
|
||||||
|
|
Loading…
Add table
Reference in a new issue