Verified Commit b0eea001 authored by Kevin Morris's avatar Kevin Morris
Browse files

fix(pkgbase.util): filter pending requests

Closes #229



Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
parent 71e73ca6
Pipeline #14305 waiting for manual action with stages
in 3 minutes and 2 seconds
from typing import Any, Dict, List
from fastapi import Request
from sqlalchemy import and_
from aurweb import config, db, l10n, util
from aurweb.models import PackageBase, User
from aurweb.models.package_comaintainer import PackageComaintainer
from aurweb.models.package_comment import PackageComment
from aurweb.models.package_request import PackageRequest
from aurweb.models.package_request import PENDING_ID, PackageRequest
from aurweb.models.package_vote import PackageVote
from aurweb.scripts import notify
from aurweb.templates import make_context as _make_context
......@@ -43,7 +44,8 @@ def make_context(request: Request, pkgbase: PackageBase) -> Dict[str, Any]:
).scalar()
context["requests"] = pkgbase.requests.filter(
PackageRequest.ClosedTS.is_(None)
and_(PackageRequest.Status == PENDING_ID,
PackageRequest.ClosedTS.is_(None))
).count()
return context
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment