Skip to content

Commit

Permalink
Fix AttributeError if IMPORT_EXPORT_CELERY_STORAGE is not defined in …
Browse files Browse the repository at this point in the history
…django settings
  • Loading branch information
zachbellay committed Jul 31, 2023
1 parent a08f82d commit e7bc39c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion import_export_celery/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class ImportExportFileField(models.FileField):
def __init__(self, *args, **kwargs):
# If the user has specified a custom storage backend, use it.
if settings.IMPORT_EXPORT_CELERY_STORAGE:
if getattr(settings, "IMPORT_EXPORT_CELERY_STORAGE", None):
storage_class = get_storage_class(settings.IMPORT_EXPORT_CELERY_STORAGE)
kwargs["storage"] = storage_class()

Expand Down

0 comments on commit e7bc39c

Please sign in to comment.