Skip to content

Corpus datafile not properly deleted #1830

@lukavdplas

Description

@lukavdplas

What went wrong?

When you use the "reset" option in the corpus form, the data file object is removed from the database, but the CSV file is not deleted in the file system.

When you upload a new file, it is stored alongside the old one. When you index the corpus, the lingering CSV files are also included in the index.

What did you expect to happen?

When a CorpusDataFile is deleted, the CSV file should also be deleted.

Screenshot

No response

Where did you find the bug?

Version

5.19.0

Steps to reproduce

In a development environment:

  • Sign into a user account with permission to create corpora
  • Create a corpus and upload a CSV data file
  • Use the "reset" option to clear the file
  • Upload a new CSV file (or upload the same one again)
  • Check the file storage to see the duplicate file

After creating a file, you can also delete it through the admin site (in the admin form for Corpus objects); this also does not remove the file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething isn't working right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions