Skip to content

Remove relations between user and spaces on destroy account command#6041

Merged
tramuntanal merged 13 commits intodevelopfrom
feature/removing_relations_between_user_and_spaces_on_destroy_command
May 8, 2020
Merged

Remove relations between user and spaces on destroy account command#6041
tramuntanal merged 13 commits intodevelopfrom
feature/removing_relations_between_user_and_spaces_on_destroy_command

Conversation

@ivan-mr
Copy link
Copy Markdown
Contributor

@ivan-mr ivan-mr commented Apr 28, 2020

🎩 What? Why?

When a User remove his own account, the relations with spaces aren't removed. This feature add the capability of removing this relations

📌 Related Issues

📋 Subtasks

  • Add CHANGELOG entry
  • If there's a new public field, add it to GraphQL API
  • Add documentation regarding the feature
  • Add/modify seeds
  • Add tests
  • Another subtask

@ivan-mr ivan-mr marked this pull request as ready for review April 28, 2020 21:18
@ivan-mr ivan-mr linked an issue Apr 28, 2020 that may be closed by this pull request
@Leusev Leusev self-requested a review April 30, 2020 10:30
Copy link
Copy Markdown
Contributor

@tramuntanal tramuntanal left a comment

Choose a reason for hiding this comment

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

We should extract external code from core

CHANGELOG.md Outdated
- **decidim-core**: Do not leak image processing errors [\#5553](https://github.com/decidim/decidim/pull/5553)
- **decidim-core**, **decidim-proposals**, **decidim-participatory_processes**, **decidim-meetings**, **decidim-sortitions**: XSS sanitization [\#5553](https://github.com/decidim/decidim/pull/5553)
- **decidim-core**: Fix the scopes picker rendereding escaped characters [#5939](https://github.com/decidim/decidim/pull/5939)
- **decidim-core**: Fix the destroy account command removing relations with spaces [#6041](https://github.com/decidim/decidim/pull/6041)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **decidim-core**: Fix the destroy account command removing relations with spaces [#6041](https://github.com/decidim/decidim/pull/6041)
- **decidim-core**: Fix the destroy account command removing relations with spaces [\#6041](https://github.com/decidim/decidim/pull/6041)

end

def destroy_conference_speaker
Decidim::ConferenceSpeaker.where(user: @user).destroy_all
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the conferences module is not enabled, this will crash. Also core should not depend upon other modules

require "decidim/participatory_processes/test/factories"
require "decidim/assemblies/test/factories"
require "decidim/comments/test/factories"
require "decidim/conferences/test/factories"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should avoid adding external dependencies to core, even for testing, we should extract those tests to their corresponding modules

Copy link
Copy Markdown
Contributor

@tramuntanal tramuntanal left a comment

Choose a reason for hiding this comment

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

Good job @ivan-mr !

Copy link
Copy Markdown
Contributor

@Leusev Leusev left a comment

Choose a reason for hiding this comment

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

Well done @ivan-mr
for me, after have been discussing it, it seems all ok
Only one thing, it seems that tests have stuck, can you try to start them again please?
Thanks!

Copy link
Copy Markdown
Contributor

@Leusev Leusev left a comment

Choose a reason for hiding this comment

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

Test now are ok, thanks!

@ivan-mr
Copy link
Copy Markdown
Contributor Author

ivan-mr commented May 5, 2020

Hi @decidim/product ,
You can check this PR in staging

@andreslucena
Copy link
Copy Markdown
Member

@ivan-mr I've checked it on staging, with both Assemblies and Conferences, LGTM! 👍

@tramuntanal tramuntanal merged commit fcbfe3f into develop May 8, 2020
@tramuntanal tramuntanal deleted the feature/removing_relations_between_user_and_spaces_on_destroy_command branch May 8, 2020 08:39
ace pushed a commit to aspgems/decidim that referenced this pull request May 12, 2020
* feature/initiatives_search_fo_new_design:
  Updates changelog
  Harmonizes the design of initiatives search in FO
  New question type "Matrix" in questionnaires (decidim#5948)
  Add filter options to Timeline and Activity tabs (decidim#5845)
  Remove relations between user and spaces on destroy account command (decidim#6041)
  Explain how to initialize a custom oauth2 client provider (decidim#6055)
  Reenable main tests on Crowdin PRs (decidim#6076)
  Enum and readonly component settings (decidim#6001)
  New Crowdin translations (decidim#6066)
  Add missing notifications (decidim#5906)
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.

When deleting an account, its user roles are not destroyed

4 participants