works but cannot change address
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user