mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(FastAPI): added /requests (get) route
Introduces `aurweb.defaults` and `aurweb.filters`. `aurweb.filters` is a location developers can put their additional Jinja2 filters and/or functions. We should slowly move all of our filters over here, where it makes sense. `aurweb.defaults` is a new module which hosts some default constants and utility functions, starting with offsets (O) and per page values (PP). As far as the new GET /requests is concerned, we match up here to PHP's implementation, with some minor improvements: Improvements: * PP on this page is now configurable: 50 (default), 100, or 250. * Example: `https://localhost:8444/requests?PP=250` Modifications: * The pagination is a bit different, but serves the exact same purpose. * "Last" no longer goes to an empty page. * Closes: https://gitlab.archlinux.org/archlinux/aurweb/-/issues/14 Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
c164abe256
commit
99482f9962
11 changed files with 341 additions and 17 deletions
19
setup.cfg
19
setup.cfg
|
@ -6,17 +6,22 @@ ignore = E741, W503
|
|||
max-line-length = 127
|
||||
max-complexity = 10
|
||||
|
||||
# aurweb/routers/accounts.py
|
||||
# Ignore some unavoidable flake8 warnings; we know this is against
|
||||
# pycodestyle, but some of the existing codebase uses `I` variables,
|
||||
# PEP8, but some of the existing codebase uses `I` variables,
|
||||
# so specifically silence warnings about it in pre-defined files.
|
||||
#
|
||||
# In E741, the 'I', 'O', 'l' are ambiguous variable names.
|
||||
# Our current implementation uses these variables through HTTP
|
||||
# and the FastAPI form specification wants them named as such.
|
||||
# In C901's case, our process_account_form function is way too
|
||||
# complex for PEP (too many if statements). However, we need to
|
||||
# process these anyways, and making it any more complex would
|
||||
# just add confusion to the implementation.
|
||||
#
|
||||
# With {W503,W504}, PEP8 does not want us to break lines before
|
||||
# or after a binary operator. We have many scripts that already
|
||||
# do this, so we're ignoring it here.
|
||||
ignore = E741, W503, W504
|
||||
|
||||
# aurweb/routers/accounts.py
|
||||
# Ignore over-reaching complexity.
|
||||
# TODO: This should actually be addressed so we do not ignore C901.
|
||||
#
|
||||
# test/test_ssh_pub_key.py
|
||||
# E501 is detected due to our >127 width test constant. Ignore it.
|
||||
|
@ -24,7 +29,7 @@ max-complexity = 10
|
|||
# Anything like this should be questioned.
|
||||
#
|
||||
per-file-ignores =
|
||||
aurweb/routers/accounts.py:E741,C901
|
||||
aurweb/routers/accounts.py:C901
|
||||
test/test_ssh_pub_key.py:E501
|
||||
aurweb/routers/packages.py:E741
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue