closing payments page for coaches
This commit is contained in:
@@ -3,7 +3,7 @@ from statements import *
|
||||
|
||||
def paidplans_view(request):
|
||||
if not request.user.is_anonymous():
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
|
||||
messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
|
||||
else:
|
||||
@@ -21,7 +21,7 @@ def billing_view(request):
|
||||
url = reverse('promembership')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
|
||||
messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
|
||||
@@ -72,7 +72,7 @@ def upgrade_view(request):
|
||||
url = reverse('promembership')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
|
||||
messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
|
||||
@@ -117,7 +117,7 @@ def downgrade_view(request):
|
||||
url = reverse('promembership')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
|
||||
messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
|
||||
@@ -172,7 +172,7 @@ def plan_stop_view(request):
|
||||
url = reverse('promembership')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
subscriptions = []
|
||||
|
||||
@@ -200,7 +200,7 @@ def plan_tobasic_view(request,id=0):
|
||||
url = reverse('promembership')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
if r.paidplan.paymentprocessor == 'braintree':
|
||||
success, themessages,errormessages = braintreestuff.cancel_subscription(r,id)
|
||||
@@ -229,7 +229,7 @@ def upgrade_confirm_view(request,planid = 0):
|
||||
url = reverse(billing_view)
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
|
||||
messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
|
||||
@@ -257,7 +257,7 @@ def downgrade_confirm_view(request,planid = 0):
|
||||
url = reverse(billing_view)
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
client_token = braintreestuff.get_client_token(r)
|
||||
|
||||
@@ -283,7 +283,7 @@ def payment_confirm_view(request,planid = 0):
|
||||
url = reverse(billing_view)
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
|
||||
messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
|
||||
@@ -306,7 +306,7 @@ def checkouts_view(request):
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
if r.paymentprocessor != 'braintree' and r.paymenttype == 'recurring':
|
||||
messages.error(request,'Automated payment processing is currently only available through BrainTree (by PayPal). You are currently on a recurring payment plan with PayPal. Contact the site administrator at support@rowsandall.com before you proceed')
|
||||
@@ -354,7 +354,7 @@ def upgrade_checkouts_view(request):
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
if request.method != 'POST':
|
||||
url = reverse(paidplans_view)
|
||||
@@ -400,7 +400,7 @@ def downgrade_checkouts_view(request):
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
if request.method != 'POST':
|
||||
url = reverse(paidplans_view)
|
||||
@@ -447,7 +447,7 @@ def payment_completed_view(request):
|
||||
amount = request.GET.get('amount',0)
|
||||
|
||||
|
||||
r = getrequestrower(request)
|
||||
r = request.user.rower
|
||||
|
||||
return render(request,
|
||||
"payment_completed.html",
|
||||
@@ -461,8 +461,8 @@ def downgrade_completed_view(request):
|
||||
if not PAYMENT_PROCESSING_ON:
|
||||
url = reverse('promembership')
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
r = getrequestrower(request)
|
||||
|
||||
r = request.user.rower
|
||||
|
||||
return render(request,
|
||||
"downgrade_completed.html",
|
||||
|
||||
@@ -4363,11 +4363,11 @@ def team_workout_upload_view(request,message="",
|
||||
rowerform.fields['user'].queryset = User.objects.filter(rower__isnull=False,rower__team__in=myteams).distinct()
|
||||
return render(request, 'team_document_form.html',
|
||||
{'form':form,
|
||||
'teams':get_my_teams(request.user),
|
||||
# 'teams':get_my_teams(request.user),
|
||||
'optionsform': optionsform,
|
||||
'active': 'nav-workouts',
|
||||
'breadcrumbs':breadcrumbs,
|
||||
'rower':r,
|
||||
# 'rower':r,
|
||||
'rowerform':rowerform,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user