From edf97311e72e8e5df3937843396d3af55be31a28 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Mon, 15 Oct 2018 11:45:50 +0200 Subject: [PATCH] Fix image deletion issue caused by S3 storage fix --- src/wiki/plugins/images/models.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/wiki/plugins/images/models.py b/src/wiki/plugins/images/models.py index bf0cd9f1..f25ca1ed 100644 --- a/src/wiki/plugins/images/models.py +++ b/src/wiki/plugins/images/models.py @@ -110,16 +110,10 @@ def on_image_revision_delete(instance, *args, **kwargs): # Remove image file instance.image.delete(save=False) - - try: - path = instance.image.path.split("/")[:-1] - except NotImplementedError: - # This backend storage doesn't implement 'path' so there is no path to delete - return try: path = instance.image.path.split("/")[:-1] - except NotImplemented: + except NotImplementedError: # This backend storage doesn't implement 'path' so there is no path to delete return -- 2.45.2