Private
Public Access
1
0

works but cannot change address

This commit is contained in:
Sander Roosendaal
2021-03-24 06:35:25 +01:00
parent 9a06a8902f
commit a9091bfed7
12 changed files with 419 additions and 10 deletions

View File

@@ -2473,9 +2473,6 @@ class PlannedSessionDelete(DeleteView):
return obj
@user_passes_test(can_plan,login_url="/rowers/paidplans",
message="This functionality requires a Coach or Self-Coach plan",
redirect_field_name=None)
def rower_view_instantplan(request,id='',userid=0):
r = getrequestrower(request,userid=userid)
if not id:
@@ -2521,6 +2518,12 @@ def rower_view_instantplan(request,id='',userid=0):
).order_by("-date")
if request.method == 'POST':
if not can_plan(request.user):
messages.error(request,'You must be on a <a href="/rowers/paidplans">paid plan</a> to use this functionality')
url = reverse('rower_view_instantplan',kwargs={
'id':id,
})
return HttpResponseRedirect(url)
form = TrainingPlanForm(request.POST,user=request.user)
if form.is_valid():