django-orphaned icon indicating copy to clipboard operation
django-orphaned copied to clipboard

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

Open joerick opened this issue 11 years ago • 0 comments

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

joerick avatar Nov 26 '13 10:11 joerick