You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a resource or upload an XLSForm to a project and save.
Edit the resource or project and click "remove" next to the file field.
Cancel editing.
Try to access the file on S3.
Actual behavior
The file is deleted from S3, whether the model instance is saved or not. If the user removes the file from the field and then cancels editing, the database will still have the link but the resource does not exist.
Expected behavior
The file should only be deleted when the model instance is actually saved. That means removing the file from S3 should be moved from django-buckets into the respective model. Before saving we need to check whether the file was removed and then delete the file from S3. If the file was replace with a new file, the old file should be removed.
Currently, this affects the following models (probably not exhaustive):
Project (for XLSForms)
Resource
The text was updated successfully, but these errors were encountered:
Steps to reproduce the error
Actual behavior
The file is deleted from S3, whether the model instance is saved or not. If the user removes the file from the field and then cancels editing, the database will still have the link but the resource does not exist.
Expected behavior
The file should only be deleted when the model instance is actually saved. That means removing the file from S3 should be moved from django-buckets into the respective model. Before saving we need to check whether the file was removed and then delete the file from S3. If the file was replace with a new file, the old file should be removed.
Currently, this affects the following models (probably not exhaustive):
Project
(for XLSForms)Resource
The text was updated successfully, but these errors were encountered: