Skip to content

Skipped directories can be deleted because django_orphaned sees the parent as empty #9

@joerick

Description

@joerick

Here's my structure:

media/
media/squarei/
media/squarei/defaults
media/squarei/defaults/example1.png
media/squarei/defaults/example2.png
media/squarei/user_upload.png

My config looks like this

ORPHANED_APPS_MEDIABASE_DIRS = {
    'squarei': {
        'root': MEDIA_ROOT,
        'skip': (
            os.path.join(MEDIA_ROOT, 'squarei/defaults'),
        ),
    }
}

django_orphaned looks at the media/squarei directory and decides it's empty, because no FileFields refer to it. But the skipped directory is in there, and is deleted when django_orphaned deletes media/squarei

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions