Skip to content

Fix user sign up with invalid name#9896

Merged
ahukkanen merged 3 commits intodevelopfrom
fix/account-invalid-name
Oct 25, 2022
Merged

Fix user sign up with invalid name#9896
ahukkanen merged 3 commits intodevelopfrom
fix/account-invalid-name

Conversation

@andreslucena
Copy link
Copy Markdown
Member

🎩 What? Why?

If you register (aka sign up) with an invalid name, the form gives an error but it doesn't tell it explicitly.

This also happens in the account form, where if you add an invalid character in your name, you'll see that there was an error but not the explicit field where this error has been.

I've also found out that in the nickname field we have this validation:

validates :nickname, presence: true, format: Decidim::User::REGEXP_NICKNAME

Mind that it says format: Decidim::User::REGEXP_NICKNAME, and according to Rails documentation it should be format: { with: Decidim::User::REGEXP_NICKNAME }. It works either way, but for consistency and not doing weird things I prefer to make it consistent.

This PR fixes those two bugs.

📌 Related Issues

Testing

  1. Go to Sign Up
  2. Fill in the required fields. With Your Name, try 'test@example.org'
  3. Submit
  4. See the error

📷 Screenshots

image

♥️ Thank you!

@andreslucena andreslucena added module: core type: fix PRs that implement a fix for a bug labels Oct 18, 2022
Copy link
Copy Markdown
Contributor

@ahukkanen ahukkanen left a comment

Choose a reason for hiding this comment

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

Nice one! We also bumped into this bug recently.

Shows the error on the field as well as the flash error.

@ahukkanen ahukkanen merged commit 72e25c4 into develop Oct 25, 2022
@ahukkanen ahukkanen deleted the fix/account-invalid-name branch October 25, 2022 08:56
eliegaboriau pushed a commit to eliegaboriau/decidim that referenced this pull request Oct 25, 2022
* Fix user sign up with invalid name

* Fix user account form with invalid name

* Make the format nickanme validation consistent
entantoencuanto added a commit that referenced this pull request Oct 26, 2022
* develop: (35 commits)
  Install turbo-rails (#9881)
  Fix conference invitations (#9664)
  Fix invalid rendering of meeting and proposal body texts (#9764)
  Make documentation site work with multiple versions (#9917)
  Bump versions on install docs (#9916)
  Standardize CSV import formats and fix private users CSV import with invalid file (#9627)
  Fix: The i18n locales selector is showing a dropdown with 3 languages (#9902)
  Make Scopes field in debates translatable (#9903)
  Make ToS agreement translatable (#9909)
  Fix issues with a11y specs (#9929)
  Remove invitations badge (#9906)
  Make initiatives order translatable (#9905)
  Add missing active actions on admin navigation menu (#9904)
  Fix user sign up with invalid name (#9896)
  Remove duplication of LastActivity queries (#9895)
  Rename IgnoredMethods to AllowedMethods in Rubocop configuration (#9893)
  Exclude malformed file from codeclimate configuration (#9910)
  Fix correct resource linking for amendments (#9887)
  Fix superposition in admin's error forms (#9871)
  Add missing i18n key in Initiatives (#9892)
  ...
entantoencuanto added a commit that referenced this pull request Oct 31, 2022
* develop: (36 commits)
  Fix proposal etiquette and length validator with base64 images (#9639)
  Install turbo-rails (#9881)
  Fix conference invitations (#9664)
  Fix invalid rendering of meeting and proposal body texts (#9764)
  Make documentation site work with multiple versions (#9917)
  Bump versions on install docs (#9916)
  Standardize CSV import formats and fix private users CSV import with invalid file (#9627)
  Fix: The i18n locales selector is showing a dropdown with 3 languages (#9902)
  Make Scopes field in debates translatable (#9903)
  Make ToS agreement translatable (#9909)
  Fix issues with a11y specs (#9929)
  Remove invitations badge (#9906)
  Make initiatives order translatable (#9905)
  Add missing active actions on admin navigation menu (#9904)
  Fix user sign up with invalid name (#9896)
  Remove duplication of LastActivity queries (#9895)
  Rename IgnoredMethods to AllowedMethods in Rubocop configuration (#9893)
  Exclude malformed file from codeclimate configuration (#9910)
  Fix correct resource linking for amendments (#9887)
  Fix superposition in admin's error forms (#9871)
  ...
Quentinchampenois pushed a commit to Quentinchampenois/decidim that referenced this pull request Nov 23, 2022
* Fix user sign up with invalid name

* Fix user account form with invalid name

* Make the format nickanme validation consistent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: core type: fix PRs that implement a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No error message when registering with e-mail address as name

2 participants