Skip to content

Commit 90bc002

Browse files
committed
Fix django-storages' AttributeError
Fix: AttributeError: 'PurePosixPath' object has no attribute 'endswith'
1 parent 2e5594f commit 90bc002

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

s3file/forms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class S3FileInputMixin:
1616
"""FileInput that uses JavaScript to directly upload to Amazon S3."""
1717

1818
needs_multipart_form = False
19-
upload_path = getattr(
19+
upload_path = str(getattr(
2020
settings, 'S3FILE_UPLOAD_PATH', pathlib.PurePosixPath('tmp', 's3file')
21-
)
22-
upload_path = safe_join(storage.location, upload_path)
21+
))
22+
upload_path = safe_join(str(storage.location), upload_path)
2323
expires = settings.SESSION_COOKIE_AGE
2424

2525
@property

0 commit comments

Comments
 (0)