We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86a001a commit 53c5554Copy full SHA for 53c5554
s3file/forms.py
@@ -1,3 +1,4 @@
1
+import base64
2
import logging
3
import pathlib
4
import uuid
@@ -68,7 +69,9 @@ def get_conditions(self, accept):
68
69
def upload_folder(self):
70
return str(pathlib.PurePosixPath(
71
self.upload_path,
- uuid.uuid4().hex,
72
+ base64.urlsafe_b64encode(
73
+ uuid.uuid4().bytes
74
+ ).decode('utf-8').rstrip('=\n'),
75
)) # S3 uses POSIX paths
76
77
class Media:
tests/test_forms.py
@@ -168,4 +168,4 @@ def test_media(self):
168
169
def test_upload_folder(self):
170
assert ClearableFileInput().upload_folder.startswith('tmp/s3file/')
171
- assert len(ClearableFileInput().upload_folder) == 43
+ assert len(ClearableFileInput().upload_folder) == 33
0 commit comments