mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 20:56: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":
|
if username == "root":
|
||||||
raise UserIsProtected
|
raise UserIsProtected
|
||||||
|
|
||||||
if (
|
if displayname:
|
||||||
displayname and len(displayname) >= 512
|
if len(displayname) >= 512: # we don't know the limitations of each service
|
||||||
): # we don't know the limitations of each service
|
|
||||||
raise DisplaynameTooLong
|
raise DisplaynameTooLong
|
||||||
|
ACTIVE_USERS_PROVIDER.update_user(
|
||||||
|
username=username,
|
||||||
|
displayname=displayname,
|
||||||
|
)
|
||||||
|
|
||||||
if directmemberof:
|
if directmemberof:
|
||||||
user = ACTIVE_USERS_PROVIDER.get_user_by_username(username=username)
|
user = ACTIVE_USERS_PROVIDER.get_user_by_username(username=username)
|
||||||
|
@ -176,11 +179,6 @@ def update_user(
|
||||||
group_name=group, users=[username]
|
group_name=group, users=[username]
|
||||||
)
|
)
|
||||||
|
|
||||||
ACTIVE_USERS_PROVIDER.update_user(
|
|
||||||
username=username,
|
|
||||||
displayname=displayname,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def get_user_by_username(username: str) -> UserDataUser:
|
def get_user_by_username(username: str) -> UserDataUser:
|
||||||
if isinstance(ACTIVE_USERS_PROVIDER, JsonUserRepository):
|
if isinstance(ACTIVE_USERS_PROVIDER, JsonUserRepository):
|
||||||
|
|
|
@ -31,7 +31,7 @@ from selfprivacy_api.repositories.users.abstract_user_repository import (
|
||||||
REDIS_TOKEN_KEY = "kanidm:token"
|
REDIS_TOKEN_KEY = "kanidm:token"
|
||||||
|
|
||||||
KANIDM_URL = "https://127.0.0.1:3013"
|
KANIDM_URL = "https://127.0.0.1:3013"
|
||||||
ADMIN_GROUPS = ["sp.admin"]
|
ADMIN_GROUPS = ["idm_admins"]
|
||||||
|
|
||||||
redis = RedisPool().get_connection()
|
redis = RedisPool().get_connection()
|
||||||
|
|
||||||
|
@ -450,7 +450,6 @@ class KanidmUserRepository(AbstractUserRepository):
|
||||||
data = {
|
data = {
|
||||||
"attrs": {
|
"attrs": {
|
||||||
"mail": [f"{username}@{get_domain()}"],
|
"mail": [f"{username}@{get_domain()}"],
|
||||||
"class": ["user"], # TODO read more about it
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue