Redirections
This commit is contained in:
parent
5c3fd60de9
commit
80a1a67643
1 changed files with 6 additions and 6 deletions
|
@ -21,7 +21,7 @@ def refill_balance(request, pk):
|
||||||
account.calc_balance()
|
account.calc_balance()
|
||||||
bal = account.balance
|
bal = account.balance
|
||||||
account.save()
|
account.save()
|
||||||
return redirect(reverse('index'))
|
return redirect(reverse('account', args=[account.pk,]))
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
|
@ -45,7 +45,7 @@ def pay(request, pk):
|
||||||
sale.save()
|
sale.save()
|
||||||
account.calc_balance()
|
account.calc_balance()
|
||||||
account.save()
|
account.save()
|
||||||
return redirect(reverse('index'))
|
return redirect(reverse('account', args=[account.pk,]))
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
|
@ -71,9 +71,9 @@ def reset_balance(request, pk):
|
||||||
sale.save()
|
sale.save()
|
||||||
account.calc_balance()
|
account.calc_balance()
|
||||||
account.save()
|
account.save()
|
||||||
return redirect(reverse('index'))
|
return redirect(reverse('account', args=[account.pk,]))
|
||||||
elif account.balance is 0:
|
elif account.balance is 0:
|
||||||
return redirect(reverse('index'))
|
return redirect(reverse('account', args=[account.pk,]))
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
|
@ -90,8 +90,8 @@ def create_account(request):
|
||||||
form = AccountForm(request.POST or None)
|
form = AccountForm(request.POST or None)
|
||||||
|
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
form.save()
|
account = form.save()
|
||||||
return redirect(reverse('index'))
|
return redirect(reverse('account', args=[account.pk,]))
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
|
|
Loading…
Reference in a new issue