Bulk actions support (#1418)

This commit is contained in:
Markos Gogoulos
2025-11-11 11:32:54 +02:00
committed by GitHub
parent 2a0cb977f2
commit e80590a3aa
160 changed files with 14100 additions and 1797 deletions

View File

@@ -31,7 +31,7 @@ class BaseFineUploader(object):
# generate new uuid to ensure this is uuid
# not sure if this will work with the chunked uploads though
self.uuid = uuid.uuid4()
self.original_filename = self.filename
self.filename = os.path.basename(self.filename)
self.filename = strip_delimiters(self.filename)
# avoid possibility of passing a fake path here

View File

@@ -65,7 +65,7 @@ class FineUploaderView(generic.FormView):
media_file = os.path.join(settings.MEDIA_ROOT, self.upload.real_path)
with open(media_file, "rb") as f:
myfile = File(f)
new = Media.objects.create(media_file=myfile, user=self.request.user)
new = Media.objects.create(media_file=myfile, user=self.request.user, title=self.upload.original_filename)
rm_file(media_file)
shutil.rmtree(os.path.join(settings.MEDIA_ROOT, self.upload.file_path))
return self.make_response({"success": True, "media_url": new.get_absolute_url()})