def update_profiles(user_id, data): dict_user = user_service_proxy.update_user(user_id, data) profile_data = {'email': data['misc']['email'], 'last_name': data['misc']['name']} profile = user_service_proxy.update_user_profile( dict_user["id"], profile_data, auth_token_username=dict_user["id"]) return dict_user
def login_adfs_user_by_private_id(private_id, data): dict_user = user_service_proxy.create_or_update_user(private_id, authentication_type='active_directory') if data: dict_user = user_service_proxy.update_user(dict_user['id'], data) profile_data = {'email': data['misc']['email'], 'last_name': data['misc']['name']} profile = user_service_proxy.update_user_profile(dict_user['id'], profile_data, auth_token_username=dict_user['id']) user_struct = namedtuple('UserStruct', ' '.join(dict_user.keys())) user = user_struct(**dict_user) # everything has been saved, we can login with flask-login return AuthUser(user)