INNER CODE UNIT · Python

_delete_file

center-for-threat-informed-defense/tram · src/tram/models.py:190

def _delete_file(path):
    # Deletes file from filesystem
    if os.path.isfile(path):
        os.remove(path)


@receiver(post_delete, sender=Document)
def delete_file_post_delete(sender, instance, *args, **kwargs):
    if instance.docfile:
        _delete_file(instance.docfile.path)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…