This commit is contained in:
burnettk 2023-02-04 00:09:43 -05:00
parent 67667828c2
commit ed34d1c343
2 changed files with 5 additions and 9 deletions

View File

@ -1,4 +1,4 @@
"""Get_env.""" """Get current user."""
from typing import Any from typing import Any
from flask import g from flask import g
@ -10,8 +10,6 @@ from spiffworkflow_backend.scripts.script import Script
class GetCurrentUser(Script): class GetCurrentUser(Script):
"""GetCurrentUser."""
@staticmethod @staticmethod
def requires_privileged_permissions() -> bool: def requires_privileged_permissions() -> bool:
"""We have deemed this function safe to run without elevated permissions.""" """We have deemed this function safe to run without elevated permissions."""

View File

@ -494,9 +494,7 @@ class AuthorizationService:
user_attributes["username"] = fallback_username user_attributes["username"] = fallback_username
if "preferred_username" in user_info: if "preferred_username" in user_info:
user_attributes["display_name"] = user_info[ user_attributes["display_name"] = user_info["preferred_username"]
"preferred_username"
]
elif "nickname" in user_info: elif "nickname" in user_info:
user_attributes["display_name"] = user_info["nickname"] user_attributes["display_name"] = user_info["nickname"]
elif "name" in user_info: elif "name" in user_info:
@ -510,9 +508,9 @@ class AuthorizationService:
): ):
if tenant_specific_field in user_info: if tenant_specific_field in user_info:
field_number = field_index + 1 field_number = field_index + 1
user_attributes[ user_attributes[f"tenant_specific_field_{field_number}"] = user_info[
f"tenant_specific_field_{field_number}" tenant_specific_field
] = user_info[tenant_specific_field] ]
if user_model is None: if user_model is None:
current_app.logger.debug("create_user in login_return") current_app.logger.debug("create_user in login_return")