Skip to content

Fix joining a meetings that the user already follows#7854

Merged
mrcasals merged 3 commits intodecidim:developfrom
mainio:fix/meetings-join-followed-meeting
Apr 19, 2021
Merged

Fix joining a meetings that the user already follows#7854
mrcasals merged 3 commits intodecidim:developfrom
mainio:fix/meetings-join-followed-meeting

Conversation

@ahukkanen
Copy link
Copy Markdown
Contributor

@ahukkanen ahukkanen commented Apr 18, 2021

🎩 What? Why?

When the user tries to join a meeting that they are already following, the server will raise the following validation error:

      Failure/Error: Decidim::CreateFollow.call(follow_form, user)
      
      ActiveRecord::RecordInvalid:
        Validation failed: User has already been taken

This fixes the issue by changing the Decidim::CreateFollow command to check if the user is already following the followable item before creating the follow.

Testing

  • Create meetings component with registrations enabled
  • Login to the system and go to a meeting that has registration
  • Follow the meeting
  • Try to register for the event (either with form or without)

📋 Checklist

  • 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.

@mrcasals mrcasals added module: meetings type: fix PRs that implement a fix for a bug labels Apr 19, 2021
@mrcasals mrcasals merged commit c730cca into decidim:develop Apr 19, 2021
@ahukkanen ahukkanen deleted the fix/meetings-join-followed-meeting branch April 19, 2021 12:25
entantoencuanto added a commit that referenced this pull request Apr 19, 2021
* develop:
  New Crowdin updates (#7850)
  Accessibility tool for development environments (#7810)
  Attempt to fix puffing-billy runtime error (#7853)
  Dynamically get all participatory space role tables for the `visible_meeting_for` query (#7855)
  Fix joining a meetings that the user already follows (#7854)
  Improve proposals import options (#7669)
  Fix proposal form attachment errors (#7856)
  New Crowdin updates (#7844)
  Fix branch name on generators (#7849)
  Conditionally render questions in election booth (#7822)
  Fix node version for version managers (#7848)
  Migrate to Webpacker (#7464)
microstudi pushed a commit to Platoniq/decidim that referenced this pull request May 14, 2021
ahukkanen added a commit to mainio/decidim that referenced this pull request Jul 13, 2021
carlobeltrame added a commit to stadtluzern/decidim-ocl that referenced this pull request Sep 28, 2021
Refs #160
Remove this once we upgrade to a decidim version that includes
decidim/decidim#7854
carlobeltrame added a commit to stadtluzern/decidim-ocl that referenced this pull request Sep 28, 2021
Refs #160
Remove this once we upgrade to a decidim version that includes
decidim/decidim#7854
carlobeltrame added a commit to stadtluzern/decidim-ocl that referenced this pull request Sep 28, 2021
Refs #160
Remove this once we upgrade to a decidim version that includes
decidim/decidim#7854
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants