mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(fastapi): fix PGP Key Fingerprint display for account/show.html
There's a space between every 4 characters in the fingerprint in PHP; we were missing it in FastAPI. This commit fixes that inconsistency. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
522177e813
commit
bfa916c7b2
2 changed files with 11 additions and 2 deletions
|
@ -432,7 +432,16 @@ async def account(request: Request, username: str):
|
|||
if not request.user.is_authenticated():
|
||||
return render_template(request, "account/show.html", context,
|
||||
status_code=HTTPStatus.UNAUTHORIZED)
|
||||
context["user"] = get_user_by_name(username)
|
||||
|
||||
# Get related User record, if possible.
|
||||
user = get_user_by_name(username)
|
||||
context["user"] = user
|
||||
|
||||
# Format PGPKey for display with a space between each 4 characters.
|
||||
k = user.PGPKey or str()
|
||||
context["pgp_key"] = " ".join([k[i:i + 4] for i in range(0, len(k), 4)])
|
||||
|
||||
# Render the template.
|
||||
return render_template(request, "account/show.html", context)
|
||||
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th>{% trans %}PGP Key Fingerprint{% endtrans %}:</th>
|
||||
<td>{{ user.PGPKey or '' }}</td>
|
||||
<td>{{ pgp_key }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{% trans %}Status{% endtrans %}:</th>
|
||||
|
|
Loading…
Add table
Reference in a new issue