fix(invites): register strftime Jinja2 filter, fix 500 error on admin invites page
This commit is contained in:
@@ -50,6 +50,14 @@ def _to_local(dt: datetime) -> datetime:
|
||||
templates.env.filters["to_local"] = _to_local
|
||||
|
||||
|
||||
def _strftime(dt: datetime, fmt: str) -> str:
|
||||
"""Format a datetime with strftime."""
|
||||
return dt.strftime(fmt) if dt else ""
|
||||
|
||||
|
||||
templates.env.filters["strftime"] = _strftime
|
||||
|
||||
|
||||
def _redirect(url: str) -> RedirectResponse:
|
||||
return RedirectResponse(url, status_code=303)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user