~netlandish/django-wiki

22a432d0940189de5852ea1b07bdfe1dd83950b3 — Benjamin Bach 6 years ago 54be463 + e87220b
Merge pull request #874 from officina/master

S3 storage fix
1 files changed, 7 insertions(+), 2 deletions(-)

M src/wiki/plugins/images/models.py
M src/wiki/plugins/images/models.py => src/wiki/plugins/images/models.py +7 -2
@@ 107,9 107,14 @@ class ImageRevision(RevisionPluginRevision):
def on_image_revision_delete(instance, *args, **kwargs):
    if not instance.image:
        return
    # Remove image file
    path = instance.image.path.split("/")[:-1]
    # Remove image file    
    instance.image.delete(save=False)
    
    try:
        path = instance.image.path.split("/")[:-1]
    except NotImplemented:
            # This backend storage doesn't implement 'path' so there is no path to delete
        return

    # Clean up empty directories