fix(api): raise error when user exists
parent
5d9231d724
commit
084c4cd438
|
@ -12,6 +12,7 @@ import yaml
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
from keycloak import KeycloakAdmin
|
from keycloak import KeycloakAdmin
|
||||||
|
|
||||||
|
from .api_exceptions import Error
|
||||||
from .helpers import get_recursive_groups, kpath2kpaths
|
from .helpers import get_recursive_groups, kpath2kpaths
|
||||||
from .postgres import Postgres
|
from .postgres import Postgres
|
||||||
|
|
||||||
|
@ -175,8 +176,12 @@ class KeycloakClient:
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
except:
|
except Exception as e:
|
||||||
log.error(traceback.format_exc())
|
log.error(traceback.format_exc())
|
||||||
|
raise Error(
|
||||||
|
"conflict",
|
||||||
|
"user/email already exists: " + str(username) + "/" + str(email),
|
||||||
|
)
|
||||||
|
|
||||||
if group:
|
if group:
|
||||||
path = "/" + group if group[1:] != "/" else group
|
path = "/" + group if group[1:] != "/" else group
|
||||||
|
|
Loading…
Reference in New Issue