-
Notifications
You must be signed in to change notification settings - Fork 8
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
Custom registration form error messages #975
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #975 +/- ##
==========================================
- Coverage 87.84% 87.81% -0.03%
==========================================
Files 26 26
Lines 2903 2898 -5
==========================================
- Hits 2550 2545 -5
Misses 353 353
Continue to review full report at Codecov.
|
Nice! Much of this validation we can also do in the front-end if we want, both with native browser controls and maybe some simple javascript. Can be nice to get immediate validation errors before submitting the form. Any chance the things like username / password lengths etc could be put in some kind of config variable to make them easier to reuse? |
@ewels Should be possible to create a custom field so I'll have a look now! |
Sorry, not in the output (these work as html attributes so can just be printed into the HTML template), I more just mean in the Python so that we don't have to keep 3 lots of validation parameters in sync.. |
@ewels Yeah started looking into that too but I think I'll create a card for this for now. But definitely a good point, should add some config for username, password etc. |
<!-- Unit --> | ||
{% if unit %} | ||
Unit name: | ||
{{ unit }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks ok!
Added custom messages. Currently not showing up, for them to actually be visible we need to add
novalidate
to the html form.dev
branch