Private
Public Access
1
0

got team upload working

This commit is contained in:
2025-10-22 14:12:03 +02:00
parent 6ca40ad6ba
commit c76334c50a
7 changed files with 104 additions and 285 deletions

View File

@@ -141,17 +141,7 @@ def handle_uploaded_image(i): # pragma: no cover
def handle_uploaded_file(f):
fname = f.name
if hasattr(f, 'temporary_file_path'):
file_path = f.temporary_file_path()
else:
import tempfile
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
for chunk in f.chunks():
temp_file.write(chunk)
file_path = temp_file.name
return fname, file_path
fname = f.name
ext = fname.split('.')[-1]
fname = '%s.%s' % (uuid.uuid4(), ext)
fname2 = 'media/'+fname