-
Notifications
You must be signed in to change notification settings - Fork 5
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
Check validity of username at signup #9
Comments
Why is In general I don't see a point in checking usernames against a pattern. You'll need to check them against the real database eventually |
I considered it bad because the student arrived to Imperial in 2010 therefore isnt a UG student probably. The issue is that TeachDB is updated very late (late September) and I'm not sure when are other databases updated and if we have access to them. Given that we want to allocate the students ASAP it will be too late. |
I don't think we should be inferring this much at a regex stage. Probably better to just check that there are some numbers and there are some letters, and they are below some sensible limit. |
Possible regexp candidate: |
Even better Edit: This won't actually work for everyone, use |
Detailed Description
When a student is signing up the form should check whether the provided username is valid.
Context
This change will reduce the number of usernames submitted which contain typo's. It will also verify that the username provided isn't an arbitrary string.
Possible Implementation
Validating of user input into forms is done within forms.py. Usage of RegEx is preferred over manual string parsing. If an invalid username is provided then the form should raise a ValidationError.
Example of valid usernames:
Example of invalid usernames:
The text was updated successfully, but these errors were encountered: