From 898c7b27df83446ecd2f587feee79feeeb86cc92 Mon Sep 17 00:00:00 2001 From: Yogesh Mahajan Date: Fri, 18 Oct 2024 19:30:42 +0530 Subject: [PATCH] Fix the Jinja2 error for python 3.8. --- web/pgadmin/templates/security/login_user.html | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/web/pgadmin/templates/security/login_user.html b/web/pgadmin/templates/security/login_user.html index 4bd4944ee..9b30b390f 100644 --- a/web/pgadmin/templates/security/login_user.html +++ b/web/pgadmin/templates/security/login_user.html @@ -5,15 +5,12 @@ {% set _ = ns.langOptions.append({'value': key, 'label': lang}) %} {% endfor %} {% set oauth2_config = [] %} -{% set oauth2_config_to_be_included = ['OAUTH2_NAME', 'OAUTH2_DISPLAY_NAME', 'OAUTH2_ICON', 'OAUTH2_BUTTON_COLOR' ] %} -{% for oauth_client in config.OAUTH2_CONFIG %} -{% set _tmp = [] %} -{% for key, value in oauth_client.items() %} -{% if key in oauth2_config_to_be_included %} -{% set _ = _tmp.append((key, value)) %} -{% endif %} -{% endfor %} -{% set _ = oauth2_config.append(dict.from_keys(_tmp)) %} +{% for i in config.OAUTH2_CONFIG %} + {% set _tmp = oauth2_config.append({'OAUTH2_NAME': config.OAUTH2_CONFIG[loop.index-1].get('OAUTH2_NAME', ''), + 'OAUTH2_BUTTON_COLOR': config.OAUTH2_CONFIG[loop.index-1].get('OAUTH2_BUTTON_COLOR', ''), + 'OAUTH2_DISPLAY_NAME': config.OAUTH2_CONFIG[loop.index-1].get('OAUTH2_DISPLAY_NAME', ''), + 'OAUTH2_ICON': config.OAUTH2_CONFIG[loop.index-1].get('OAUTH2_ICON', '') + }) %} {% endfor %} {% set page_props = {