fixing
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user