Private
Public Access
1
0

email confirmations

This commit is contained in:
Sander Roosendaal
2020-02-16 19:56:46 +01:00
parent 51e5805145
commit 6bdcbd2d21
2 changed files with 20 additions and 3 deletions

View File

@@ -4329,9 +4329,12 @@ def thumbnails_set(r,id,favorites):
l = len(rowdata)
maxlength = 50
if l > maxlength:
bins = np.linspace(rowdata['time'].min(),rowdata['time'].max(),maxlength)
groups = rowdata.groupby(np.digitize(rowdata['time'],bins))
rowdata = groups.mean()
try:
bins = np.linspace(rowdata['time'].min(),rowdata['time'].max(),maxlength)
groups = rowdata.groupby(np.digitize(rowdata['time'],bins))
rowdata = groups.mean()
except KeyError:
pass
for f in favorites:
workstrokesonly = not f.reststrokes

View File

@@ -4424,6 +4424,7 @@ def workout_upload_api(request):
optionsform = TeamUploadOptionsForm(post_data)
rowerform = TeamInviteForm(post_data)
rowerform.fields.pop('email')
fstr = ''
try:
fstr = post_data['file']
nn, ext = os.path.splitext(fstr)
@@ -4531,9 +4532,22 @@ def workout_upload_api(request):
pass
else: # form invalid
if fstr:
os.remove(fstr)
message = form.errors
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}
return JSONResponse(status=200,data=message)