fix(api): raise error when user exists

darta 2022-05-16 12:12:52 +02:00
parent 5d9231d724
commit 084c4cd438
1 changed files with 6 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import yaml
from jinja2 import Environment, FileSystemLoader
from keycloak import KeycloakAdmin
from .api_exceptions import Error
from .helpers import get_recursive_groups, kpath2kpaths
from .postgres import Postgres
@ -175,8 +176,12 @@ class KeycloakClient:
],
}
)
except:
except Exception as e:
log.error(traceback.format_exc())
raise Error(
"conflict",
"user/email already exists: " + str(username) + "/" + str(email),
)
if group:
path = "/" + group if group[1:] != "/" else group