aboutsummaryrefslogtreecommitdiff
path: root/gn3/auth/authorisation/users/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/auth/authorisation/users/views.py')
-rw-r--r--gn3/auth/authorisation/users/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gn3/auth/authorisation/users/views.py b/gn3/auth/authorisation/users/views.py
index 5015cac..e3901b4 100644
--- a/gn3/auth/authorisation/users/views.py
+++ b/gn3/auth/authorisation/users/views.py
@@ -51,7 +51,8 @@ def user_roles() -> Response:
return jsonify(tuple(
dictify(role) for role in _user_roles(conn, token.user)))
-def __valid_password__(password, confirm_password) -> str:
+def validate_password(password, confirm_password) -> str:
+ """Validate the provided password."""
if len(password) < 8:
raise PasswordError("The password must be at least 8 characters long.")
@@ -85,7 +86,7 @@ def register_user() -> Response:
form = request.form
email = validate_email(form.get("email", "").strip(),
check_deliverability=True)
- password = __valid_password__(
+ password = validate_password(
form.get("password", "").strip(),
form.get("confirm_password", "").strip())
user_name = __valid_username__(form.get("user_name", "").strip())