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

bug: harddelete command can fail to remove users due to foreign key on story map model #1541

Open
shrouxm opened this issue Nov 7, 2024 · 0 comments

Comments

@shrouxm
Copy link
Member

shrouxm commented Nov 7, 2024

Description

See title.

Steps To Reproduce

See failing job: https://dashboard.render.com/web/srv-cclqgbirrk007qgqoml0

Additional context

StoryMap's created_by field is a non-nullable foreign key to the user's table with an on_delete policy of DO_NOTHING, which causes the underlying DB constraint to fail. We need to consult with product about how to handle this:

  • should we delete user's story maps when they delete their account? is there already an adequate warning message about this?
  • if we shouldn't, we need to change DO_NOTHING to SET_NULL and ensure that the rest of the system is equipped to handle this case (it probably isn't)

Size will depend on which of these two options we go with, first is very easy, second is probably easy-medium but hard to say without having touched the story maps code.

We can do a temporary fix without consulting product by just not hard deleting users for now.

@shrouxm shrouxm added this to Terraso Nov 7, 2024
@github-project-automation github-project-automation bot moved this to Todo in Terraso Nov 7, 2024
@shrouxm shrouxm changed the title bug: harddelete command can fail to remove users due to foreign key on story map model. bug: harddelete command can fail to remove users due to foreign key on story map model Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant