Skip to content

Commit

Permalink
Fixed storage for correct generated migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronny Vedrilla committed Mar 29, 2018
1 parent 141c47b commit bdc9624
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 2 additions & 3 deletions chunked_upload/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ def default_upload_to(instance, filename):
STORAGE = getattr(settings, 'CHUNKED_UPLOAD_STORAGE_CLASS', lambda: None)()
# Use temporary storage for chunks
else:
import tempfile
from django.core.files.storage import FileSystemStorage
STORAGE = FileSystemStorage(location=tempfile.gettempdir)
from chunked_upload.storages import TemporaryFileStorage
STORAGE = TemporaryFileStorage()


# Boolean that defines if the ChunkedUpload model is abstract or not
Expand Down
7 changes: 7 additions & 0 deletions chunked_upload/storages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import tempfile

from django.core.files.storage import FileSystemStorage


class TemporaryFileStorage(FileSystemStorage):
location = tempfile.gettempdir()

0 comments on commit bdc9624

Please sign in to comment.