dimagi / open-chat-studio

A web based platform for building Chatbots backed by Large Language Models
BSD 3-Clause "New" or "Revised" License
16 stars 7 forks source link

add django-cleanup to cleanup files on model deletion #831

Closed snopoke closed 2 weeks ago

snopoke commented 2 weeks ago

Description

Add the django-cleanup app to manage file deletion when DB models referencing them are deleted.

Noting this from their docs:

This app is designed with the assumption that each file is referenced only once. If you are sharing a file over two or more model instances you will not have the desired functionality. Be cautious of copying model instances, as this will cause a file to be shared by more than one instance. If you want to reference a file from multiple models add a level of indirection. That is, use a separate file model that is referenced from other models through a foreign key. There are many file management apps already available in the django ecosystem that fulfill this behavior.

I don't think that's an issue for us but worth noting.

codecov-commenter commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Additional details and impacted files

:loudspeaker: Thoughts on this report? Let us know!