basic withdraw and upgrade
This commit is contained in:
@@ -2621,10 +2621,24 @@ def rower_view_instantplan(request,id='',userid=0):
|
||||
'id':id,
|
||||
})
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
# check if plan is free or credits are sufficient
|
||||
if plan.price > 0:
|
||||
if plan.price > r.eurocredits:
|
||||
messages.error(request,'You did not have enough credit to purchase this plan')
|
||||
url = reverse('rower_view_instantplan',kwargs={
|
||||
'id':id,
|
||||
})
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
|
||||
form = InstantPlanSelectForm(request.POST,targets=targets)
|
||||
|
||||
|
||||
if form.is_valid():
|
||||
if plan.price > 0:
|
||||
eurocredits = credits.withdraw(plan.price,r)
|
||||
|
||||
plansteps = response.json()
|
||||
name = form.cleaned_data['name']
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user