fix: delete unnecessary call

This commit is contained in:
dettlaff 2024-12-19 05:03:25 +04:00
parent ea22935b88
commit 2e5a8c8b7b
2 changed files with 8 additions and 11 deletions

View file

@ -145,10 +145,13 @@ def update_user(
if username == "root":
raise UserIsProtected
if (
displayname and len(displayname) >= 512
): # we don't know the limitations of each service
if displayname:
if len(displayname) >= 512: # we don't know the limitations of each service
raise DisplaynameTooLong
ACTIVE_USERS_PROVIDER.update_user(
username=username,
displayname=displayname,
)
if directmemberof:
user = ACTIVE_USERS_PROVIDER.get_user_by_username(username=username)
@ -176,11 +179,6 @@ def update_user(
group_name=group, users=[username]
)
ACTIVE_USERS_PROVIDER.update_user(
username=username,
displayname=displayname,
)
def get_user_by_username(username: str) -> UserDataUser:
if isinstance(ACTIVE_USERS_PROVIDER, JsonUserRepository):

View file

@ -31,7 +31,7 @@ from selfprivacy_api.repositories.users.abstract_user_repository import (
REDIS_TOKEN_KEY = "kanidm:token"
KANIDM_URL = "https://127.0.0.1:3013"
ADMIN_GROUPS = ["sp.admin"]
ADMIN_GROUPS = ["idm_admins"]
redis = RedisPool().get_connection()
@ -450,7 +450,6 @@ class KanidmUserRepository(AbstractUserRepository):
data = {
"attrs": {
"mail": [f"{username}@{get_domain()}"],
"class": ["user"], # TODO read more about it
}
}