Merge branch 'release/v10.01'
This commit is contained in:
@@ -4329,9 +4329,12 @@ def thumbnails_set(r,id,favorites):
|
|||||||
l = len(rowdata)
|
l = len(rowdata)
|
||||||
maxlength = 50
|
maxlength = 50
|
||||||
if l > maxlength:
|
if l > maxlength:
|
||||||
|
try:
|
||||||
bins = np.linspace(rowdata['time'].min(),rowdata['time'].max(),maxlength)
|
bins = np.linspace(rowdata['time'].min(),rowdata['time'].max(),maxlength)
|
||||||
groups = rowdata.groupby(np.digitize(rowdata['time'],bins))
|
groups = rowdata.groupby(np.digitize(rowdata['time'],bins))
|
||||||
rowdata = groups.mean()
|
rowdata = groups.mean()
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
for f in favorites:
|
for f in favorites:
|
||||||
workstrokesonly = not f.reststrokes
|
workstrokesonly = not f.reststrokes
|
||||||
|
|||||||
@@ -132,20 +132,20 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
|
|||||||
if testing:
|
if testing:
|
||||||
print('Workout id = {workoutid}'.format(workoutid=workoutid))
|
print('Workout id = {workoutid}'.format(workoutid=workoutid))
|
||||||
|
|
||||||
if workoutid[0]:
|
# if workoutid[0]:
|
||||||
link = settings.SITE_URL+reverse(
|
# link = settings.SITE_URL+reverse(
|
||||||
therower.defaultlandingpage,
|
# therower.defaultlandingpage,
|
||||||
kwargs = {
|
# kwargs = {
|
||||||
'id':encoder.encode_hex(workoutid[0]),
|
# 'id':encoder.encode_hex(workoutid[0]),
|
||||||
}
|
# }
|
||||||
)
|
# )
|
||||||
|
#
|
||||||
if not testing:
|
# if not testing:
|
||||||
if therower.getemailnotifications and not therower.emailbounced:
|
# if therower.getemailnotifications and not therower.emailbounced:
|
||||||
email_sent = send_confirm(
|
# email_sent = send_confirm(
|
||||||
therower.user, title, link,
|
# therower.user, title, link,
|
||||||
uploadoptions
|
# uploadoptions
|
||||||
)
|
# )
|
||||||
|
|
||||||
return workoutid
|
return workoutid
|
||||||
|
|
||||||
|
|||||||
@@ -4424,6 +4424,7 @@ def workout_upload_api(request):
|
|||||||
optionsform = TeamUploadOptionsForm(post_data)
|
optionsform = TeamUploadOptionsForm(post_data)
|
||||||
rowerform = TeamInviteForm(post_data)
|
rowerform = TeamInviteForm(post_data)
|
||||||
rowerform.fields.pop('email')
|
rowerform.fields.pop('email')
|
||||||
|
fstr = ''
|
||||||
try:
|
try:
|
||||||
fstr = post_data['file']
|
fstr = post_data['file']
|
||||||
nn, ext = os.path.splitext(fstr)
|
nn, ext = os.path.splitext(fstr)
|
||||||
@@ -4531,9 +4532,22 @@ def workout_upload_api(request):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
else: # form invalid
|
else: # form invalid
|
||||||
|
if fstr:
|
||||||
|
os.remove(fstr)
|
||||||
message = form.errors
|
message = form.errors
|
||||||
return JSONResponse(status=400,data=message)
|
return JSONResponse(status=400,data=message)
|
||||||
|
|
||||||
|
if fstr:
|
||||||
|
os.remove(fstr)
|
||||||
|
|
||||||
|
if r.getemailnotifications and not r.emailbounced:
|
||||||
|
link = settings.SITE_URL+reverse(
|
||||||
|
therower.defaultlandingpage,
|
||||||
|
kwargs = {
|
||||||
|
'id':encoder.encode_hex(w.id),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
email_sent = send_confirm(r.user, t, link, '')
|
||||||
message = {'status': 'true','id':w.id}
|
message = {'status': 'true','id':w.id}
|
||||||
return JSONResponse(status=200,data=message)
|
return JSONResponse(status=200,data=message)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user