~netlandish/django-wiki

e87220b64deda8e22f96040875a183f85bb66b52 — Andrea Maschio 6 years ago 54be463
fix for s3 storage unimplemented path method
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