Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2023-01-15 14:47:34 +01:00
parent 37d5a5439c
commit e9e7326505
2 changed files with 36 additions and 30 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ from rq.exceptions import NoSuchJobError
import threading import threading
import redis import redis
import colorsys import colorsys
import re
import zipfile import zipfile
import bleach import bleach
import arrow import arrow
+6
View File
@@ -5234,6 +5234,8 @@ def workout_upload_api(request):
r = None r = None
if form.is_valid(): if form.is_valid():
t = form.cleaned_data['title'] t = form.cleaned_data['title']
t = re.sub('\r',' ',t)
t = re.sub('\n',' ',t)
boattype = form.cleaned_data['boattype'] boattype = form.cleaned_data['boattype']
workouttype = form.cleaned_data['workouttype'] workouttype = form.cleaned_data['workouttype']
try: try:
@@ -6701,6 +6703,7 @@ def workout_summary_edit_view(request, id, message="", successmessage=""
vals = None vals = None
# feeling lucky / ruptures # feeling lucky / ruptures
if request.method == 'POST' and "ruptures" in request.POST: if request.method == 'POST' and "ruptures" in request.POST:
try:
df = pd.DataFrame({ df = pd.DataFrame({
'spm': rowdata.df[' Cadence (stokes/min)'], 'spm': rowdata.df[' Cadence (stokes/min)'],
'power': rowdata.df[' Power (watts)'], 'power': rowdata.df[' Power (watts)'],
@@ -6735,6 +6738,9 @@ def workout_summary_edit_view(request, id, message="", successmessage=""
intervalString = s intervalString = s
form = SummaryStringForm(initial={'intervalstring': intervalString}) form = SummaryStringForm(initial={'intervalstring': intervalString})
except KeyError:
messages.error(request, "Nope, you were not lucky")
# We have submitted the mini language interpreter # We have submitted the mini language interpreter
if request.method == 'POST' and "intervalstring" in request.POST: if request.method == 'POST' and "intervalstring" in request.POST:
form = SummaryStringForm(request.POST) form = SummaryStringForm(request.POST)