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

fix: conf_password also must required field #2184

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gugupy
Copy link
Contributor

@gugupy gugupy commented Feb 6, 2024

Description

ADDITIONAL INFORMATION

  • Has associated issue:
  • Is CRUD MVC related.
  • Is Auth, RBAC security related.
  • Changes the security db schema.
  • Introduces new feature
  • Removes existing feature

In ResetPasswordForm and RegisterUserDBForm field conf_password accept empty password.

EqualTo only validated on submit.

So adding DataRequired() validator to conf_password field.

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6f00efc) 79.71% compared to head (fa9009f) 79.71%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2184   +/-   ##
=======================================
  Coverage   79.71%   79.71%           
=======================================
  Files          72       72           
  Lines        8990     8990           
=======================================
  Hits         7166     7166           
  Misses       1824     1824           
Flag Coverage Δ
python 79.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

validators=[
DataRequired(),
EqualTo("password", message=lazy_gettext("Passwords must match")),
],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if conf_password and password must be equal, and password is required, doesn't imply that conf_password is required also?

Copy link
Contributor Author

@gugupy gugupy Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, its imply but only validated once the user submitted the form.

Here EqualTo validator allows empty value for conf_password.

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.

None yet

2 participants