From 6f81dd2435f77c0840aee5cfd1d453340ad50d33 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Feb 2020 09:43:26 -0600 Subject: [PATCH] mgr/dashboard: behave when pwdUpdateRequired key is missing Fixes: https://tracker.ceph.com/issues/44271 Signed-off-by: Sage Weil --- src/pybind/mgr/dashboard/controllers/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/dashboard/controllers/auth.py b/src/pybind/mgr/dashboard/controllers/auth.py index e7ceca3d673..68c3827b4e8 100644 --- a/src/pybind/mgr/dashboard/controllers/auth.py +++ b/src/pybind/mgr/dashboard/controllers/auth.py @@ -24,8 +24,8 @@ class Auth(RESTController): user_perms, pwd_expiration_date, pwd_update_required = None, None, None if user_data: user_perms = user_data.get('permissions') - pwd_expiration_date = user_data.get('pwdExpirationDate') - pwd_update_required = user_data.get('pwdUpdateRequired') + pwd_expiration_date = user_data.get('pwdExpirationDate', None) + pwd_update_required = user_data.get('pwdUpdateRequired', False) if user_perms is not None: logger.debug('Login successful') -- 2.39.5