mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
change(FastAPI): allow User.notified to accept a Package OR PackageBase
In addition, shorten the `package_notifications` relationship to `notifications`. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
4abbf9a917
commit
f849e8b696
4 changed files with 23 additions and 9 deletions
|
@ -127,9 +127,7 @@ async def make_single_context(request: Request,
|
|||
context["comments"] = pkgbase.comments
|
||||
context["is_maintainer"] = (request.user.is_authenticated()
|
||||
and request.user.ID == pkgbase.MaintainerUID)
|
||||
context["notified"] = request.user.package_notifications.filter(
|
||||
PackageNotification.PackageBaseID == pkgbase.ID
|
||||
).scalar()
|
||||
context["notified"] = request.user.notified(pkgbase)
|
||||
|
||||
context["out_of_date"] = bool(pkgbase.OutOfDateTS)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue