fixing
This commit is contained in:
@@ -1111,6 +1111,7 @@ class PowerIntervalUpdateForm(forms.Form):
|
||||
|
||||
|
||||
boattypes = mytypes.boattypes
|
||||
ergtypes = mytypes.ergtypes
|
||||
workouttypes = mytypes.workouttypes
|
||||
ww = list(workouttypes)
|
||||
ww.append(tuple(('all', 'All')))
|
||||
@@ -1143,7 +1144,7 @@ class AnalysisOptionsForm(forms.Form):
|
||||
modality = forms.ChoiceField(choices=workouttypes,
|
||||
label='Workout Type',
|
||||
initial='all')
|
||||
waterboattype = forms.MultipleChoiceField(choices=boattypes,
|
||||
waterboattype = forms.MultipleChoiceField(choices=boattypes+ergtypes,
|
||||
label='Water Boat Type',
|
||||
initial=mytypes.waterboattype)
|
||||
|
||||
|
||||
@@ -3582,7 +3582,7 @@ class Workout(models.Model):
|
||||
boattype = self.boattype
|
||||
workouttype = self.workouttype
|
||||
|
||||
if workouttype != 'water':
|
||||
if workouttype not in ['water','rower']:
|
||||
try:
|
||||
stri = u'{d} {n} {dist}m {duration} {workouttype} {ownerfirst} {ownerlast}'.format(
|
||||
d=date.strftime('%Y-%m-%d'),
|
||||
|
||||
@@ -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