mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-20 13:36:05 -05:00
Bulk actions support (#1418)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()})
|
||||
|
||||
Reference in New Issue
Block a user