Skip to content

Commit 9b77674

Browse files
committed
CH-214 adapt functions to keycloak update new behaviour
1 parent 30366e5 commit 9b77674

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • libraries/cloudharness-common/cloudharness/auth

libraries/cloudharness-common/cloudharness/auth/keycloak.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,15 @@ def user_add_update_attribute(self, user_id, attribute_name, attribute_value):
594594
user = self.get_user(user_id)
595595
attributes = user.get('attributes', {}) or {}
596596
attributes[attribute_name] = attribute_value
597+
user.attributes = attributes
597598
admin_client.update_user(
598599
user_id,
599600
{
600-
'attributes': attributes
601-
})
601+
'attributes': attributes,
602+
'username': user.username,
603+
'email': user.email,
604+
}
605+
)
602606

603607
@with_refreshtoken
604608
def user_delete_attribute(self, user_id, attribute_name):
@@ -617,7 +621,9 @@ def user_delete_attribute(self, user_id, attribute_name):
617621
admin_client.update_user(
618622
user_id,
619623
{
620-
'attributes': attributes
624+
'attributes': attributes,
625+
'username': user.username,
626+
'email': user.email,
621627
})
622628
return True
623629
return False

0 commit comments

Comments
 (0)