Permalink
Browse files

Merge pull request #907 from officina/s3-storage-fix

S3 storage fix
  • Loading branch information...
benjaoming committed Aug 29, 2018
2 parents 60c0589 + e18ef7e commit e2fc45fc243ea38bf957adda86efa44c870b5a46
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/wiki/plugins/images/models.py
@@ -107,8 +107,15 @@ def __str__(self):
def on_image_revision_delete(instance, *args, **kwargs):
if not instance.image:
return
# 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]

0 comments on commit e2fc45f

Please sign in to comment.