Mercurial > p > roundup > code
diff roundup/configuration.py @ 5976:71c68961d9f4
- issue2550920 - Optionally detect duplicate username at registration.
Added config option to allow detection of duplicate username when the
user tries to register. Previously user was rejected when dupliate
name found at confirmation step.
Optional as it can make username guessing easier.
Testing is in place for this.
Also attempted to make the unfriendly error message:
'node with key "username" exists'
into a translatable friendly error:
"Username 'username' already exists."
This is missing any test. It is also fragile as I capture the
ValueError exception and see that the exception matches:
'node with key "username" exists'
If it does reassert the friendly message. Otherwise just re-raise
existing exception. If the "node with key..." message is translated
the friendly override will not trigger.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 09 Nov 2019 16:33:42 -0500 |
| parents | 98a8509ce45c |
| children | 55f5060e0508 |
line wrap: on
line diff
--- a/roundup/configuration.py Sat Nov 09 00:41:53 2019 -0500 +++ b/roundup/configuration.py Sat Nov 09 16:33:42 2019 -0500 @@ -803,6 +803,12 @@ "registration form. This limits the rate at which bots\n" "can attempt to sign up. Limit can be disabled by setting\n" "the value to 0."), + (BooleanOption, 'registration_prevalidate_username', "no", + "When registering a user, check that the username\n" + "is available before sending confirmation email.\n" + "Usually a username conflict is detected when\n" + "confirming the registration. Disabled by default as\n" + "it can be used for guessing existing usernames.\n" ), (SameSiteSettingOption, 'samesite_cookie_setting', "Lax", """Set the mode of the SameSite cookie option for the session cookie. Choices are 'Lax' or
