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 for saving an Election that wasn't blocked #10903

Merged
merged 4 commits into from
Jul 14, 2023

Conversation

andreslucena
Copy link
Member

🎩 What? Why?

While working in decidim-elections, I noticed that if you have an Election with an `start_date in the past (ie an ongoing Election that wasn't sent to the Bulletin Board), the application doesn't allow you to make some changes in it (like creating/deleting/updating Questions and Answers).

This doesn't make sense, as it shouldn't allow admins to make changes only once the Election was sent to the Bulletin Board, as making changes once the Election was sent could generate synchronization issues (like adding a question after it was sent). For signaling this we don't use the start_date attribute, but the blocked_at attribute, accessible through the election#blocked? method.

This PR fixes that.

Testing

(Before the patch)

  1. Sign in as admin and go to the admin panel (/admin)
  2. Go to an Election inside of a Participatory Space (ie an Assembly)
  3. Change the start_date of an Election to some time in the past (like 1 week ago)
  4. Try to update a Question or an Answer
  5. See that's not allowed

(After the patch)

  1. Sign in as admin and go to the admin panel (/admin)
  2. Go to an Election inside of a Participatory Space (ie an Assembly)
  3. Change the start_date of an Election to some time in the past (like 1 week ago)
  4. Try to update a Question or an Answer
  5. See that's allowed

♥️ Thank you!

@andreslucena andreslucena added type: bug Issues that describe a bug module: elections labels May 24, 2023
@alecslupu alecslupu added type: fix PRs that implement a fix for a bug and removed type: bug Issues that describe a bug labels May 24, 2023
@andreslucena andreslucena marked this pull request as draft June 7, 2023 07:02
@andreslucena andreslucena marked this pull request as ready for review June 7, 2023 15:09
@andreslucena andreslucena requested a review from a team June 7, 2023 15:09
@alecslupu alecslupu merged commit 8d1fb38 into develop Jul 14, 2023
@alecslupu alecslupu deleted the fix/elections-started-but-not-created branch July 14, 2023 05:48
entantoencuanto added a commit that referenced this pull request Jul 19, 2023
…ure/redesign-staging

* feature/redesign-participatory-process-steps:
  Hide active step item from dropdown metadata if there are no steps present
  Remove participatory process steps index path, controller and views
  Adapt participatory process steps specs to redesign using steps modal
  Change paths in participatory processes events to not use steps index path
  Change path in process dropdown metadata for steps to call index with steps modal open
  Extract to process step modal to a cell with an option to display open
  allow passing options to Dialogs via data-attributes
  Typo fix guide_example_apps.adoc (#11202)
  Fix open-ended dependency on doorkeeper (#11197)
  Fix for saving an Election that wasn't blocked (#10903)
  CSV & JSON export function fix (#11145)
  Fix dependencies between modules with i18n strings  (#11156)
  Add Events support for Command (#11064)
  Load the editor JS only when needed with redesign (#11177)
  Bump rails from 6.1.7.3 to 6.1.7.4 (#11172)
  Fix the unused keyword arguments for the budgets workflows (#11174)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: elections 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