mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add account edit (settings) routes
* Added account_url filter to jinja2 environment. This produces a path to the user's account url (/account/{username}). * Updated archdev-navbar to link to new edit route. + Added migrate_cookies(request, response) to aurweb.util, a function that simply migrates the request cookies to response and returns it. + Added account_edit tests to test_accounts_routes.py. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
d323c1f95b
commit
4e9ef6fb00
7 changed files with 522 additions and 5 deletions
|
@ -12,7 +12,7 @@ from fastapi.responses import HTMLResponse
|
|||
|
||||
import aurweb.config
|
||||
|
||||
from aurweb import captcha, l10n, time
|
||||
from aurweb import captcha, l10n, time, util
|
||||
|
||||
# Prepare jinja2 objects.
|
||||
loader = jinja2.FileSystemLoader(os.path.join(
|
||||
|
@ -27,6 +27,9 @@ env.filters["tr"] = l10n.tr
|
|||
env.filters["captcha_salt"] = captcha.captcha_salt_filter
|
||||
env.filters["captcha_cmdline"] = captcha.captcha_cmdline_filter
|
||||
|
||||
# Add account utility filters.
|
||||
env.filters["account_url"] = util.account_url
|
||||
|
||||
|
||||
def make_context(request: Request, title: str, next: str = None):
|
||||
""" Create a context for a jinja2 TemplateResponse. """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue