Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
1ea138e1
Commit
1ea138e1
authored
3 years ago
by
Alexander Kreft
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: Better message for pw requirements
parent
fb1da439
No related branches found
No related tags found
1 merge request
!33
MAINT: change arguments of create_user
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosdb/common/administration.py
+18
-3
18 additions, 3 deletions
src/caosdb/common/administration.py
with
18 additions
and
3 deletions
src/caosdb/common/administration.py
+
18
−
3
View file @
1ea138e1
...
...
@@ -156,13 +156,22 @@ def _update_user(name, realm=None, password=None, status=None,
return
con
.
put_form_data
(
entity_uri_segment
=
"
User/
"
+
(
realm
+
"
/
"
+
name
if
realm
is
not
None
else
name
),
params
=
params
,
**
kwargs
).
read
()
except
HTTPResourceNotFoundError
as
e
:
e
.
msg
=
"
User does not exist.
"
raise
raise
e
except
HTTPForbiddenError
as
e
:
e
.
msg
=
"
You are not permitted to update this user.
"
raise
raise
e
except
HTTPClientError
as
e
:
if
e
.
status
==
409
:
e
.
msg
=
"
Entity does not exist.
"
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
"""
print
(
e
.
msg
)
raise
...
...
@@ -191,7 +200,13 @@ def _insert_user(name, password=None, status=None, email=None, entity=None, **kw
e
.
msg
=
"
User name is already in use.
"
if
e
.
status
==
422
:
e
.
msg
=
"
Maybe the password does not match the required standard?
"
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment