better organized training plan page
This commit is contained in:
@@ -14416,7 +14416,7 @@ class TrainingPlanDelete(DeleteView):
|
||||
|
||||
def get_object(self, *args, **kwargs):
|
||||
obj = super(TrainingPlanDelete, self).get_object(*args, **kwargs)
|
||||
if not checkaccessuser(self.request.user,obj.plan.rower):
|
||||
if not checkaccessuser(self.request.user,obj.rower):
|
||||
raise PermissionDenied('You are not allowed to delete this training plan')
|
||||
|
||||
return obj
|
||||
@@ -14493,7 +14493,9 @@ def rower_trainingplan_view(request,id=0):
|
||||
raise PermissionDenied("Access denied")
|
||||
|
||||
createmacrofillers(plan)
|
||||
macrocycles = TrainingMacroCycle.objects.filter(plan=plan).order_by("startdate")
|
||||
macrocycles = TrainingMacroCycle.objects.filter(
|
||||
plan=plan,
|
||||
type='userdefined').order_by("startdate")
|
||||
|
||||
|
||||
r = plan.rower
|
||||
@@ -14510,10 +14512,11 @@ def rower_trainingplan_view(request,id=0):
|
||||
m.actualtrimp = 0
|
||||
|
||||
|
||||
mesocycles = TrainingMesoCycle.objects.filter(plan=m).order_by("startdate")
|
||||
mesocycles = TrainingMesoCycle.objects.filter(
|
||||
plan=m,
|
||||
type='userdefined').order_by("startdate")
|
||||
|
||||
for me in mesocycles:
|
||||
createmicrofillers(me)
|
||||
me.plantime = 0
|
||||
me.actualtime = 0
|
||||
me.plandistance = 0
|
||||
@@ -14523,7 +14526,9 @@ def rower_trainingplan_view(request,id=0):
|
||||
me.plantrimp = 0
|
||||
me.actualtrimp = 0
|
||||
|
||||
microcycles = TrainingMicroCycle.objects.filter(plan=me).order_by("startdate")
|
||||
microcycles = TrainingMicroCycle.objects.filter(
|
||||
plan=me,
|
||||
type='userdefined').order_by("startdate")
|
||||
|
||||
for mm in microcycles:
|
||||
sps = PlannedSession.objects.filter(
|
||||
|
||||
Reference in New Issue
Block a user