Private
Public Access
1
0
This commit is contained in:
2024-01-22 21:12:21 +01:00
parent 7b84f659c5
commit 61089d4c2b
3 changed files with 13 additions and 9 deletions

View File

@@ -100,6 +100,11 @@ def analysis_new(request,
waterboattype = mytypes.waterboattype
try:
waterboattype = options['waterboattype']
except KeyError:
pass
if request.method == 'POST':
thediv = get_call()
dateform = DateRangeForm(request.POST)
@@ -122,7 +127,7 @@ def analysis_new(request,
modalities = [m[0] for m in mytypes.workouttypes]
else: # pragma: no cover
modalities = [modality]
if modality != 'water':
if modality not in ['water','rower']:
waterboattype = [b[0] for b in mytypes.boattypes]
options['modalities'] = modalities
@@ -133,7 +138,7 @@ def analysis_new(request,
except KeyError:
worldclass = False
options['cpoverlay'] = worldclass
chartform = AnalysisChoiceForm(request.POST)
if chartform.is_valid():
options['form'] = chartform.cleaned_data
@@ -160,6 +165,9 @@ def analysis_new(request,
for b in mytypes.boattypes:
if b[0] not in waterboattype: # pragma: no cover
negtypes.append(b[0])
for b in mytypes.ergtypes:
if b[0] not in waterboattype: # pragma: no cover
negtypes.append(b[0])
startdate = datetime.datetime.combine(startdate, datetime.time())
enddate = datetime.datetime.combine(enddate, datetime.time(23, 59, 59))
@@ -179,11 +187,6 @@ def analysis_new(request,
except (ValueError, AttributeError): # pragma: no cover
pass
negtypes = []
for b in mytypes.boattypes:
if b[0] not in waterboattype: # pragma: no cover
negtypes.append(b[0])
rankingtypes = [False,True]
if ranking:
rankingtypes = [True]