From 130584e280cb394dc1a2854b0f82f5bdfdc0f785 Mon Sep 17 00:00:00 2001 From: Adam Dodman Date: Thu, 5 Oct 2017 17:58:16 +0100 Subject: [PATCH] Update to use uid_to_user everywhere --- main.py | 6 +++--- templates/add_quote.html | 2 +- templates/layout.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index a7182a0..e104591 100644 --- a/main.py +++ b/main.py @@ -34,12 +34,12 @@ def gen_page(template, data=None): print("DATA") pp.pprint(data) if 'username' in session: - return render_template(template, user=session["username"], data=data) + return render_template(template, user=session["uid"], data=data) else: return render_template(template, data=data) if 'username' in session: - return render_template(template, user=session["username"]) + return render_template(template, user=session["uid"]) return render_template(template) # Load User Table into variable @@ -239,7 +239,7 @@ def utility_processor(): # This probably needs optimizing for user in userdb: if user[0] == uid: - return user[1] + return "%s (%s)" % (user[1], user[2]) return dict(uid_to_user=uid_to_user) if __name__ == "__main__": diff --git a/templates/add_quote.html b/templates/add_quote.html index ba7bfef..ca74781 100644 --- a/templates/add_quote.html +++ b/templates/add_quote.html @@ -15,7 +15,7 @@ diff --git a/templates/layout.html b/templates/layout.html index 77c54c2..ea11ba9 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -33,7 +33,7 @@ Sign Out {% else %} Login