Skip to content

Remove ImportedFile when making a version no active #10682

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

Closed
stsewd opened this issue Aug 29, 2023 · 0 comments · Fixed by #10684
Closed

Remove ImportedFile when making a version no active #10682

stsewd opened this issue Aug 29, 2023 · 0 comments · Fixed by #10684
Labels
Accepted Accepted issue on our roadmap

Comments

@stsewd
Copy link
Member

stsewd commented Aug 29, 2023

What's the problem this feature will solve?

When a version is marked as inactive, we delete their files from storage,
so there is no need to track those in the ImportedFile table.

Describe the solution you'd like

Delete those files after the version has been marked as inactive. We should also delete existing imported files from not built versions.

qs = ImportedFile.objects.filter(version__built=False)
qs.count()
qs.delete()

Additional context

#10681

@stsewd stsewd added the Accepted Accepted issue on our roadmap label Aug 29, 2023
stsewd added a commit that referenced this issue Aug 29, 2023
stsewd added a commit that referenced this issue Aug 31, 2023
* Delete imported files when deactivating version

Closes #10682

* Remove dead code

We aren't using this, and tests were failing because
of the storage class being overridden by other tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant