diff --git a/magpie/api/management/register/register_views.py b/magpie/api/management/register/register_views.py index 930bbe54a..021d44012 100644 --- a/magpie/api/management/register/register_views.py +++ b/magpie/api/management/register/register_views.py @@ -15,6 +15,7 @@ from magpie.api.management.group import group_formats as gf from magpie.api.management.register import register_utils as ru from magpie.api.management.user import user_utils as uu +from magpie import models if TYPE_CHECKING: from pyramid.httpexceptions import HTTPException diff --git a/magpie/api/management/user/user_utils.py b/magpie/api/management/user/user_utils.py index 77c610591..a53b03207 100644 --- a/magpie/api/management/user/user_utils.py +++ b/magpie/api/management/user/user_utils.py @@ -332,6 +332,7 @@ def get_user_service_resources_permissions_dict(user, service, request, inherit_ def check_user_info(user_name, email, password, group_name): # type: (Str, Str, Str, Str) -> None + """Validates provided user information to ensure they are adequate for user creation.""" ax.verify_param(user_name, not_none=True, not_empty=True, http_error=HTTPBadRequest, param_name=u"user_name", msg_on_fail=s.Users_CheckInfo_Name_BadRequestResponseSchema.description) @@ -343,6 +344,8 @@ def check_user_info(user_name, email, password, group_name): msg_on_fail=s.Users_CheckInfo_ReservedKeyword_BadRequestResponseSchema.description) ax.verify_param(email, not_none=True, not_empty=True, http_error=HTTPBadRequest, param_name=u"email", msg_on_fail=s.Users_CheckInfo_Email_BadRequestResponseSchema.description) + ax.verify_param(email, regex_match=True, param_compare=r"", http_error=HTTPBadRequest, + param_name=u"email", msg_on_fail=s.Users_CheckInfo_Email_BadRequestResponseSchema.description) ax.verify_param(password, not_none=True, not_empty=True, http_error=HTTPBadRequest, param_name=u"password", msg_on_fail=s.Users_CheckInfo_Password_BadRequestResponseSchema.description) diff --git a/magpie/ui/management/templates/add_user.mako b/magpie/ui/management/templates/add_user.mako index 92ac4c2f0..9fa6106b5 100644 --- a/magpie/ui/management/templates/add_user.mako +++ b/magpie/ui/management/templates/add_user.mako @@ -35,7 +35,7 @@ Email:
diff --git a/magpie/ui/management/templates/edit_service.mako b/magpie/ui/management/templates/edit_service.mako index 013dd7ebb..29cfc7600 100644 --- a/magpie/ui/management/templates/edit_service.mako +++ b/magpie/ui/management/templates/edit_service.mako @@ -129,7 +129,7 @@ Protected URL: %if edit_mode == "edit_url":