Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict new usernames #520

Conversation

christophmeissner
Copy link
Contributor

@christophmeissner christophmeissner commented Mar 25, 2022

New users may only select usernames following these rules:

  • min 3, max 16 characters
  • starts with a letter
  • ends with a letter, number or a _
  • may only contain letters, numbers,., _
  • for readability: no consequtive (double) characters . or _ or any combination of those two, (ie. no .., __, ._ or _.)

fixes #494

pitpalme
pitpalme previously approved these changes Mar 29, 2022
accounts/forms.py Outdated Show resolved Hide resolved
accounts/forms.py Outdated Show resolved Hide resolved
New users may only select usernames following this rules:
* min 3, max 16 characters
* starts with an letter and ends with an letter or number
* may only contain [a-zA-Z0-9_.]

fixes coders4help#494
* allow umlauts
* allow _ at end
* simplify regex
* add positive tests for allowed usernames
Error message was changed but the expected error text in the test was not changed
pitpalme
pitpalme previously approved these changes Mar 29, 2022
@christophmeissner christophmeissner merged commit 9811b20 into coders4help:develop Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't allow e-mail address as username
2 participants