This commit is contained in:
burnettk 2023-02-04 00:09:43 -05:00
parent f1c61581ff
commit e5a56f6ef6
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 flask import g
@ -10,8 +10,6 @@ from spiffworkflow_backend.scripts.script import Script
class GetCurrentUser(Script):
"""GetCurrentUser."""
@staticmethod
def requires_privileged_permissions() -> bool:
"""We have deemed this function safe to run without elevated permissions."""

View File

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