ds
This commit is contained in:
@@ -137,7 +137,7 @@ def is_invalid_file(file_path):
|
||||
return True, ""
|
||||
|
||||
|
||||
def upload_handler(uploadoptions, filename):
|
||||
def upload_handler(uploadoptions, filename, createworkout=False, debug=False, **kwargs):
|
||||
valid, message = valid_uploadoptions(uploadoptions)
|
||||
if not valid: # pragma: no cover
|
||||
return {
|
||||
@@ -167,12 +167,24 @@ def upload_handler(uploadoptions, filename):
|
||||
"message": "Your zip file is being processed. You will be notified when it is complete."
|
||||
}
|
||||
job_id = generate_job_id()
|
||||
if 'id' not in uploadoptions and createworkout:
|
||||
w = Workout(
|
||||
user=get_rower_from_uploadoptions(uploadoptions),
|
||||
duration='00:00:00'
|
||||
)
|
||||
w.save()
|
||||
uploadoptions['id'] = w.id
|
||||
|
||||
if 'id' in uploadoptions:
|
||||
job_id = encoder.encode_hex(uploadoptions['id'])
|
||||
|
||||
_ = myqueue(
|
||||
queuehigh,
|
||||
process_single_file,
|
||||
filename,
|
||||
uploadoptions,
|
||||
job_id)
|
||||
|
||||
return {
|
||||
"status": "processing",
|
||||
"job_id": job_id,
|
||||
|
||||
Reference in New Issue
Block a user