Private
Public Access
1
0

more fixes

This commit is contained in:
Sander Roosendaal
2020-01-15 15:55:41 +01:00
parent 88703bb34e
commit 8683d8eaa4
10 changed files with 29 additions and 44 deletions

View File

@@ -1909,7 +1909,6 @@ class PlannedSessionDelete(DeleteView):
@user_passes_test(isplanmember,login_url="/rowers/paidplans",
message="This functionality requires a Coach or Self-Coach plan",
redirect_field_name=None)
@permission_required('rower.add_plan',fn=get_rower_by_userid,raise_exception=True)
def rower_create_trainingplan(request,id=0):
therower = getrequestrower(request,userid=id)
theuser = therower.user
@@ -1977,7 +1976,8 @@ def rower_create_trainingplan(request,id=0):
p.save()
for athlete in athletes:
p.rowers.add(athlete)
if can_plan_user(request.user,athlete):
p.rowers.add(athlete)
targets = TrainingTarget.objects.filter(
@@ -2012,7 +2012,7 @@ def rower_create_trainingplan(request,id=0):
breadcrumbs = [
{
'url':reverse(plannedsessions_view,
kwargs={'userid':userid}),
kwargs={'userid':id}),
'name': 'Plan'
},
{