Skip to content

Commit b777617

Browse files
authored
Merge pull request #11 from qld-gov-au/develop
Fix fullname update
2 parents b978269 + 2e99a03 commit b777617

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ckanext/oidc_pkce/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def same_id() -> bool:
137137

138138

139139
def munge_password() -> bool:
140-
"""Override existing pasword for account with a random one, preventing
140+
"""Override existing password for account with a random one, preventing
141141
direct login.
142142
143143
"""

ckanext/oidc_pkce/interfaces.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def get_oidc_user(self, userinfo: dict[str, Any]) -> Optional[model.User]:
5050
data = self.oidc_info_into_user_dict(userinfo)
5151
data["id"] = user.id
5252
data.pop("name")
53+
if user_dict.get("fullname", None):
54+
data.pop("fullname") # Don't override fullname if it is already populated
5355

5456
if not config.munge_password():
5557
data.pop("password")
@@ -59,9 +61,7 @@ def get_oidc_user(self, userinfo: dict[str, Any]) -> Optional[model.User]:
5961

6062
user_dict.update(data)
6163
user_dict.pop("name") # Username is untouched, so exclude it from the update payload.
62-
if user_dict.get("fullname", None):
63-
data.pop("fullname") # Don't override fullname if it is already populated
64-
tk.get_action("user_update")({"user": admin["name"]}, user_dict)
64+
tk.get_action("user_patch")({"user": admin["name"]}, user_dict)
6565

6666
signals.user_sync.send(user.id)
6767
return user

0 commit comments

Comments
 (0)