diff --git a/docs/user/accounts.rst b/docs/user/accounts.rst index 7d0493ba2..0682b4de0 100644 --- a/docs/user/accounts.rst +++ b/docs/user/accounts.rst @@ -15,7 +15,9 @@ by clicking the account creation button, and you will be presented with an accou The fields of this form are as follows: Name - Your username on the wiki. Will appear in the history section of any wiki item which you edit. This is a required field. + Your username on the wiki. Names must not contain "/", ":", or "," characters, invisible unicode + characters, or leading or trailing whitespace characters. Embedded single space characters + are allowed. This is a required field. Password Your password for logging into your new account. Remember to pick a strong password with a mix @@ -55,7 +57,12 @@ Personal Settings Personal settings include wiki language and locale, username and alias. Name - Your username, as it will appear on the wiki and in the history pages of wiki items which you edit. + Your username, as it will appear on the login form, the history pages of wiki items + which you edit, and in the footer of items you have edited. All of these places will be + rendered as links to your home page in the `users` namespace. + If desired, name may be a comma separated list of names. For example, if it is tedious + to type your long full name at login, you may create a short alias name: `JohnDoe, jd`. + Alias names are only useful at login. Display-Name The display name can be used to override your username, so you will still log in using your username diff --git a/src/moin/apps/frontend/views.py b/src/moin/apps/frontend/views.py index ed79b9e50..367708486 100644 --- a/src/moin/apps/frontend/views.py +++ b/src/moin/apps/frontend/views.py @@ -2447,6 +2447,14 @@ class UserSettingsUIForm(Form): (_("The username '{name}' is already in use.").format(name=name), "error") ) success = False + if not user.normalizeName(name) == name: + response["flash"].append( + ( + _("The username '{name}' contains invalid characters").format(name=name), + "error", + ) + ) + success = False if part == "notification": if ( form["email"].value != flaskg.user.email