improved #480
This commit is contained in:
@@ -479,8 +479,9 @@ def workouts_join_select(request,
|
||||
modalities = [m[0] for m in mytypes.workouttypes]
|
||||
modality = 'all'
|
||||
|
||||
if request.method == 'POST' and 'daterange' in request.POST:
|
||||
if request.method == 'POST':
|
||||
dateform = DateRangeForm(request.POST)
|
||||
modalityform = TrendFlexModalForm(request.POST)
|
||||
if dateform.is_valid():
|
||||
startdate = dateform.cleaned_data['startdate']
|
||||
enddate = dateform.cleaned_data['enddate']
|
||||
@@ -488,15 +489,6 @@ def workouts_join_select(request,
|
||||
enddatestring = enddate.strftime('%Y-%m-%d')
|
||||
request.session['startdate'] = startdatestring
|
||||
request.session['enddate'] = enddatestring
|
||||
else:
|
||||
dateform = DateRangeForm(initial={
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
})
|
||||
|
||||
|
||||
if request.method == 'POST' and 'modality' in request.POST:
|
||||
modalityform = TrendFlexModalForm(request.POST)
|
||||
if modalityform.is_valid():
|
||||
modality = modalityform.cleaned_data['modality']
|
||||
waterboattype = modalityform.cleaned_data['waterboattype']
|
||||
@@ -511,6 +503,13 @@ def workouts_join_select(request,
|
||||
|
||||
request.session['modalities'] = modalities
|
||||
request.session['waterboattype'] = waterboattype
|
||||
else:
|
||||
dateform = DateRangeForm(initial={
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
})
|
||||
|
||||
|
||||
|
||||
negtypes = []
|
||||
for b in mytypes.boattypes:
|
||||
|
||||
Reference in New Issue
Block a user