Skip to content

Commit

Permalink
Fix #110 -- Enable S3Input support for dummy storage
Browse files Browse the repository at this point in the history
  • Loading branch information
codingjoe committed Jul 15, 2020
1 parent faf7527 commit 2e5594f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ you do not need to alter your code at all.

The ``ClearableFileInput`` widget is only than automatically replaced
when the ``DEFAULT_FILE_STORAGE`` setting is set to
``django-storages``\ ’ ``S3Boto3Storage``.
``django-storages``\ ’ ``S3Boto3Storage`` or the dummy ``FileSystemStorage``
is enabled.

Setting up the AWS S3 bucket
----------------------------
Expand Down
4 changes: 2 additions & 2 deletions s3file/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class S3FileConfig(AppConfig):

def ready(self):
from django import forms
from django.core.files.storage import default_storage
from django.core.files.storage import FileSystemStorage, default_storage
from storages.backends.s3boto3 import S3Boto3Storage

from .forms import S3FileInputMixin

if isinstance(default_storage, S3Boto3Storage) and \
if isinstance(default_storage, (S3Boto3Storage, FileSystemStorage)) and \
S3FileInputMixin not in forms.ClearableFileInput.__bases__:
forms.ClearableFileInput.__bases__ = \
(S3FileInputMixin,) + forms.ClearableFileInput.__bases__
Expand Down

0 comments on commit 2e5594f

Please sign in to comment.