From 9388bc00070c1103b3e14fa7ba03b0de7464a025 Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 1 Dec 2022 20:35:40 +0000 Subject: Prevent error when user account doesn't have an email address (which is currently the case if you use Github or ORCID to log-in) --- wqflask/wqflask/user_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/wqflask/user_session.py b/wqflask/wqflask/user_session.py index 1ed5b802..39b2aec1 100644 --- a/wqflask/wqflask/user_session.py +++ b/wqflask/wqflask/user_session.py @@ -150,7 +150,7 @@ class UserSession: def user_email(self): """Shortcut to the user email address""" - if self.logged_in: + if self.logged_in and 'email_address' in self.user_details: return self.user_details['email_address'] else: return None -- cgit v1.2.3