mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
housekeep: define filters in their own modules
This patch cleans up aurweb.templates and removes direct module-level initialization of the environment. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
fca175ed84
commit
211ca5e49c
16 changed files with 159 additions and 159 deletions
|
@ -13,7 +13,7 @@ from starlette.requests import HTTPConnection
|
|||
|
||||
import aurweb.config
|
||||
|
||||
from aurweb import db, l10n, util
|
||||
from aurweb import db, filters, l10n, util
|
||||
from aurweb.models import Session, User
|
||||
from aurweb.models.account_type import ACCOUNT_TYPE_ID
|
||||
|
||||
|
@ -166,7 +166,7 @@ def _auth_required(auth_goal: bool = True):
|
|||
raise HTTPException(status_code=HTTPStatus.BAD_REQUEST,
|
||||
detail=_("Bad Referer header."))
|
||||
url = referer[len(aur) - 1:]
|
||||
url = "/login?" + util.urlencode({"next": url})
|
||||
url = "/login?" + filters.urlencode({"next": url})
|
||||
return RedirectResponse(url, status_code=int(HTTPStatus.SEE_OTHER))
|
||||
return wrapper
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue