Epic in-progress: validation overhaul for registration form #9198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature/refactor. Adds extensive pre-submit validation to the registration form, showing error messages and preventing submission in the event of badly formatted or already-taken entries.
Note: Several of the tasks for this project are distributed among different issues, as noted in the checklist below, but the full project overview/checklist will be maintained here for simplicity.
Full Project Checklist
Required form behavior / tasks
jQuery
error rendering for registration form #9190email
is entered, the error should appear before form submitjQuery
error rendering for registration form #9190forms.py
such as the spam check into the realtime validation processusername
is entered, the error should appear before form submitjQuery
error rendering for registration form #9190password
is entered, the error should appear before form submittype="email"
,required
, and regexpattern
attributes to form inputs to prevent bad submissionforms.py
and a new form class toform.py
validate
class from form if possible to avoid showing duplicate error messages as a result of HTML validationjs
behavior to prevent submission (not just show an error msg) if backend checks like existing email address failHTML
validationOther Requirements
required
attributeFun possibilities
account.py
API endpoint and intorealtime_account_validation.js
to avoid unnecessary API callsTechnical
To avoid duplication and merge conflicts, the current changes in this branch are limited to:
forms.py
and a new class inform.py
)Testing
Testing is currently (mostly) blocked by #9190, which will fix the realtime error-rendering bug.
In the meantime, the HTML validation can still be tested like so:
Screenshot
[To be added]
Stakeholders
@cdrini