publishers_10.py 338 B

12345678910
  1. def store_upload(pub, file_data, file_name, meta_data=None):
  2. """Create a unique folder for an uploaded file and begin editing it for
  3. publication.
  4. """
  5. upload = new_upload(pub, file_name, meta_data)
  6. write_file(file_data, upload.file_path)
  7. upload.status = "Queued for processing"
  8. upload.save()
  9. return upload