Skip to content

Fix to avoid registered users being invited again#7392

Merged
oriolgual merged 1 commit intodecidim:developfrom
CodiTramuntana:fix/inviting_registered_users
Feb 23, 2021
Merged

Fix to avoid registered users being invited again#7392
oriolgual merged 1 commit intodecidim:developfrom
CodiTramuntana:fix/inviting_registered_users

Conversation

@tramuntanal
Copy link
Copy Markdown
Contributor

🎩 What? Why?

Please describe your pull request.
The PR makes sure that InviteUserAgain is not invoked unless the user was previously invited and the invitation was pending. The bug is in using user.invitation_accepted? to check if the user has some invitation pending because it will return false both, when the user has an invitation pending to be accepted, and when the user was never invited (she signed up directly into the platform). This latter case is now controlled by asking user.invited_to_sign_up? to devise.

This PR also extracts repeated logic in CreateAssemblyAdmin and CreateParticipatoryProcessAdmin commands into decidim-admin/app/commands/decidim/admin/create_participatory_space_admin_user_actions.rb module.

📌 Related Issues

Link your PR to an issue

Testing

Describe the best way to test or validate your PR.
Sign up with a new user and invite her to admin an assembly. Then check that the user can still login and do not receives an invitation to register.

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

Please add screenshots of the changes you're proposing
Description

♥️ Thank you!

@tramuntanal tramuntanal marked this pull request as draft February 15, 2021 16:25
@tramuntanal tramuntanal marked this pull request as ready for review February 15, 2021 17:10
@oriolgual oriolgual merged commit a545ab2 into decidim:develop Feb 23, 2021
@mrcasals mrcasals added module: admin type: fix PRs that implement a fix for a bug labels Feb 24, 2021
@tramuntanal tramuntanal deleted the fix/inviting_registered_users branch February 24, 2021 08:24
tramuntanal added a commit to CodiTramuntana/decidim that referenced this pull request Feb 24, 2021
entantoencuanto added a commit that referenced this pull request Feb 25, 2021
* develop: (232 commits)
  Add Votings to Open Data export (#7388)
  Add order in not highlighted assemblies by weight (#7444)
  Resort Menus (#7460)
  Polling Officer Zone (#7439)
  Fix session timeout when using multiple windows or tabs (#7459)
  Fix display of debates with multiple dates (#7393)
  chore: split election tests (#7451)
  style: make selected values primary labels with delete button (#7448)
  Fix and tests to avoid registered users being invited again (#7392)
  Migrate Admin menus to Menu Registry (#7368)
  New Crowdin updates (#7338)
  Bump to carrierwave 2.2.0 (#7441)
  Voting: show callout when Polling Stations miss Polling Officers (#7417)
  Further default orders for the API (#7436)
  Fix random order inconsistencies (#7437)
  Ensure Rails is locked to 5.2.4.x series (#7430)
  Add default order by ID to API list queries (#7424)
  Update dependencies (#7422)
  Ignore warning on CI when no artifacts to upload (#7420)
  Filter and search polling officers (#7411)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error when inviting an already registered participant

3 participants