Skip to content
Snippets Groups Projects
Commit 1d45e27d authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'f-dot-in-username' into 'dev'

F dot in username

See merge request !63
parents c36376e0 6e8906a7
No related branches found
No related tags found
1 merge request!63F dot in username
Pipeline #25280 failed
...@@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### ### Fixed ###
* [caosdb-server#142](https://gitlab.com/caosdb/caosdb-server/-/issues/142)
Can't create users with dots in their user names
### Security ### ### Security ###
### Documentation ### ### Documentation ###
......
...@@ -196,17 +196,9 @@ def _update_user(name, realm=None, password=None, status=None, ...@@ -196,17 +196,9 @@ def _update_user(name, realm=None, password=None, status=None,
e.msg = "You are not permitted to update this user." e.msg = "You are not permitted to update this user."
raise e raise e
except HTTPClientError as e: except HTTPClientError as e:
if e.status == 409: for elem in etree.fromstring(e.body):
e.msg = "Entity does not exist." if elem.tag == "Error":
e.msg = elem.get("description")
if e.status == 422:
e.msg = """Maybe the password does not match the required standard?
The current requirements are:
- at least 8 characters
- at least 1 number
- at least 1 lower case character
- at least 1 upper case character
- at least 1 special character"""
raise raise
...@@ -231,17 +223,9 @@ def _insert_user(name, password=None, status=None, email=None, entity=None, **kw ...@@ -231,17 +223,9 @@ def _insert_user(name, password=None, status=None, email=None, entity=None, **kw
e.msg = "You are not permitted to insert a new user." e.msg = "You are not permitted to insert a new user."
raise e raise e
except HTTPClientError as e: except HTTPClientError as e:
if e.status == 409: for elem in etree.fromstring(e.body):
e.msg = "User name is already in use." if elem.tag == "Error":
e.msg = elem.get("description")
if e.status == 422:
e.msg = """Maybe the password does not match the required standard?
The current requirements are:
- at least 8 characters
- at least 1 number
- at least 1 lower case character
- at least 1 upper case character
- at least 1 special character"""
raise e raise e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment