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

when deleting run , pool and library_preparations are also deleted #180

Closed
luissian opened this issue Jul 10, 2023 · 2 comments · Fixed by #262
Closed

when deleting run , pool and library_preparations are also deleted #180

luissian opened this issue Jul 10, 2023 · 2 comments · Fixed by #262
Assignees
Labels
bug Something isn't working

Comments

@luissian
Copy link
Member

Description of the bug

When a run is created through the samples collection data, and when continuing with the library preparation are assigned to a pool and this pool to a run, then when using django admin to delete the run, pool and those library preparation are also deleted

Command used and terminal output

Using django admin , delete a run.

Relevant files

No response

System information

iSkyLIMs version 2.3.0.

A possible solution is class LibraryPool(models.Model)
`

register_user = models.ForeignKey(User, on_delete=models.CASCADE)
pool_state = models.ForeignKey(PoolStates, on_delete=models.CASCADE)
run_process_id = models.ForeignKey(
    RunProcess, on_delete=models.CASCADE, null=True, blank=True
)

`
Change the relation of run_process_id from ForeignKey to ManyToMany relation.

@luissian luissian added the bug Something isn't working label Jul 10, 2023
@luissian
Copy link
Member Author

To fix this issue is required the following changes:
1. Create a new field run_process with a many to many relation to RunProcess
2. Run the script during upgrade to collect all existing information on the run_process_id field.
Which collects data from old field and set in the new one.
3. Modify the code to change the old field to the new one.

@luissian luissian linked a pull request Apr 19, 2024 that will close this issue
@luissian
Copy link
Member Author

implemented on PR #262

@luissian luissian self-assigned this Apr 19, 2024
luissian added a commit that referenced this issue Apr 29, 2024
@luissian luissian closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant