mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: handle default requests when using pages
The default page shows the pending requests which were working OK if one used the Filters button. This fixes the case when someone submits by using the pager (Next, Last etc). Closes: #405 Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
This commit is contained in:
parent
c248a74f80
commit
73f0bddf0b
2 changed files with 54 additions and 2 deletions
|
@ -18,6 +18,13 @@ from aurweb.requests.util import get_pkgreq_by_id
|
|||
from aurweb.scripts import notify
|
||||
from aurweb.templates import make_context, render_template
|
||||
|
||||
FILTER_PARAMS = {
|
||||
"filter_pending",
|
||||
"filter_closed",
|
||||
"filter_accepted",
|
||||
"filter_rejected",
|
||||
}
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
|
@ -36,7 +43,7 @@ async def requests(
|
|||
|
||||
context["q"] = dict(request.query_params)
|
||||
|
||||
if len(dict(request.query_params)) == 0:
|
||||
if not dict(request.query_params).keys() & FILTER_PARAMS:
|
||||
filter_pending = True
|
||||
|
||||
O, PP = util.sanitize_params(O, PP)
|
||||
|
@ -89,7 +96,6 @@ async def requests(
|
|||
.offset(O)
|
||||
.all()
|
||||
)
|
||||
|
||||
return render_template(request, "requests.html", context)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue