Redirections

This commit is contained in:
Hugo LEVY-FALK 2018-12-14 18:32:30 +01:00
parent 5c3fd60de9
commit 80a1a67643

View file

@ -21,7 +21,7 @@ def refill_balance(request, pk):
account.calc_balance()
bal = account.balance
account.save()
return redirect(reverse('index'))
return redirect(reverse('account', args=[account.pk,]))
return render(
request,
@ -45,7 +45,7 @@ def pay(request, pk):
sale.save()
account.calc_balance()
account.save()
return redirect(reverse('index'))
return redirect(reverse('account', args=[account.pk,]))
return render(
request,
@ -71,9 +71,9 @@ def reset_balance(request, pk):
sale.save()
account.calc_balance()
account.save()
return redirect(reverse('index'))
return redirect(reverse('account', args=[account.pk,]))
elif account.balance is 0:
return redirect(reverse('index'))
return redirect(reverse('account', args=[account.pk,]))
return render(
request,
@ -90,8 +90,8 @@ def create_account(request):
form = AccountForm(request.POST or None)
if form.is_valid():
form.save()
return redirect(reverse('index'))
account = form.save()
return redirect(reverse('account', args=[account.pk,]))
return render(
request,