Skip to content

Commit

Permalink
* We actually want to delete all of the versions not the document its…
Browse files Browse the repository at this point in the history
…elf.
  • Loading branch information
bgroff committed Nov 8, 2018
1 parent f1cf2f9 commit 64ff50b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions django_kala/django_kala/platforms/aws/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def restore_document(self, document):

def delete_document(self, document):
s3 = boto3.resource('s3')
s3.Object(
settings.S3_STORAGE_BUCKET,
'media/documents/{0}'.format(document.uuid)
).delete()
for version in document.documentversion_set.all():
s3.Object(
settings.S3_STORAGE_BUCKET,
'media/documents/{0}'.format(version.uuid)
).delete()

0 comments on commit 64ff50b

Please sign in to comment.