From f7f57ebb4aaf9d5ef7fb6d1eea55e45d83173473 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 26 Sep 2023 13:41:40 +0200 Subject: [PATCH] appstore: try to fix login for people with no avatar x_x --- store/app.py | 2 +- store/templates/base.html | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/store/app.py b/store/app.py index 134319e..97bdbe1 100644 --- a/store/app.py +++ b/store/app.py @@ -416,7 +416,7 @@ def sso_login_callback(): session["user"] = { "id": user_data["external_id"][0], "username": user_data["username"][0], - "avatar_url": user_data["avatar_url"][0], + "avatar_url": user_data["avatar_url"][0] if "avatar_url" in user_data else "", } if uri_to_redirect_to_after_login: diff --git a/store/templates/base.html b/store/templates/base.html index ecc5afd..09901b8 100644 --- a/store/templates/base.html +++ b/store/templates/base.html @@ -60,15 +60,17 @@ type="button" class="group flex shrink-0 items-center rounded-md transition" > + {% if user['avatar_url'] %} Avatar -

+ {% endif %} +

{{ user['username'] }}

- +