Private
Public Access
1
0

passing tests - views.py split over multiple files

This commit is contained in:
Sander Roosendaal
2019-02-07 17:41:17 +01:00
parent a3b309fb16
commit bc8bda7a38
12 changed files with 389 additions and 365 deletions

View File

@@ -514,9 +514,9 @@ def workout_update_cp_view(request,id=0):
dataprep.runcpupdate(r)
if row.workouttype in mytypes.otwtypes:
url = reverse(otwrankings_view)
url = reverse('otwrankings_view')
else:
url = reverse(oterankings_view)
url = reverse('oterankings_view')
return HttpResponseRedirect(url)
@@ -944,7 +944,7 @@ def team_comparison_select(request,
'name': firstworkout.name
},
{
'url':reverse(team_comparison_select,kwargs={'id':id,'teamid':teamid}),
'url':reverse('team_comparison_select',kwargs={'id':id,'teamid':teamid}),
'name':'Compare Select'
},
]
@@ -955,7 +955,7 @@ def team_comparison_select(request,
'name':'Workouts'
},
{
'url':reverse(team_comparison_select,kwargs={'teamid':teamid}),
'url':reverse('team_comparison_select',kwargs={'teamid':teamid}),
'name': 'Compare Select'
},
@@ -2428,7 +2428,6 @@ def instroke_view(request,id=0):
return HttpResponseRedirect(url)
from metrics import nometrics
rowdata = rrdata(csvfile=w.csvfilename)
try:
instrokemetrics = rowdata.get_instroke_columns()
@@ -2880,33 +2879,6 @@ def workout_workflow_config2_view(request,userid=0):
})
def getfavorites(r,row):
workouttype = 'ote'
if row.workouttype in mytypes.otwtypes:
workouttype = 'otw'
matchworkouttypes = [workouttype,'all']
workoutsource = row.workoutsource
if 'speedcoach2' in row.workoutsource:
workoutsource = 'speedcoach2'
try:
favorites = FavoriteChart.objects.filter(user=r,
workouttype__in=matchworkouttypes).order_by("id")
favorites2 = FavoriteChart.objects.filter(user=r,
workouttype__in=[workoutsource]).order_by("id")
favorites = favorites | favorites2
maxfav = len(favorites)-1
except:
favorites = None
maxfav = 0
return favorites,maxfav
# Workflow View
@login_required()