mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 12:46:39 +00:00
fix: delete unnecessary call
This commit is contained in:
parent
ea22935b88
commit
2e5a8c8b7b
|
@ -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
|
||||
raise DisplaynameTooLong
|
||||
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):
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue