fix(python): add logged in date field to account/show.html

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-12-04 01:16:14 -08:00
parent 2ea4559b60
commit 224a0de784
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
2 changed files with 14 additions and 1 deletions

View file

@ -451,6 +451,13 @@ async def account(request: Request, username: str):
k = user.PGPKey or str()
context["pgp_key"] = " ".join([k[i:i + 4] for i in range(0, len(k), 4)])
login_ts = None
session = db.query(models.Session).filter(
models.Session.UsersID == user.ID).first()
if session:
login_ts = user.session.LastUpdateTS
context["login_ts"] = login_ts
# Render the template.
return render_template(request, "account/show.html", context)