Skip to content

FileNotFoundError if the file associated with a model instance has been removed, and delete() is called on a ModelForm for that instance. #76

@AbhigyaShridhar

Description

@AbhigyaShridhar

Steps to reproduce:

  • Create a model, PrivateModel and set one field as PrivateFileField
  • Create another model, say TestModel and reference PrivateModel as a foreign key
  • Run migrations and set up django admin for TestModel keeping PrivateModel as inline
  • Create a test instance for both the models
  • Go to the PRIVATE_STORAGE_ROOT path and manually delete the file associated with newly created TestModel instance
  • Now delete that instance using django admin page (by marking the inline for deletion)

Expected outcome:
The PrivateModel instance marked for deletion is removed and TestModel instance is updated successfully

Actual Outcome:
Throws FileNotFoundError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions