This commit is contained in:
Gabriel Augendre 2016-07-28 14:04:13 +02:00
parent 1807542863
commit 56846c27e2
No known key found for this signature in database
GPG key ID: D2B6A5B41FC438B1

View file

@ -30,6 +30,8 @@ def new_refund(request):
refund = form.save() refund = form.save()
refund.user = request.user refund.user = request.user
refund.save() refund.save()
messages.success(request, 'Refund created successfully')
return redirect('latest_refunds') return redirect('latest_refunds')
else: else:
form = RefundFormPublic() form = RefundFormPublic()
@ -53,6 +55,8 @@ def refund_edit(request, pk):
refund = form.save() refund = form.save()
refund.user = request.user refund.user = request.user
refund.save() refund.save()
messages.success(request, 'Refund edited successfully')
return redirect('latest_refunds') return redirect('latest_refunds')
else: else:
form = RefundFormPublic(instance=refund) form = RefundFormPublic(instance=refund)
@ -109,6 +113,8 @@ def new_payment(request):
payment = form.save(commit=False) payment = form.save(commit=False)
payment.user = request.user payment.user = request.user
payment.save() payment.save()
messages.success(request, 'Payment created successfully')
return redirect('not_refunded_payments') return redirect('not_refunded_payments')
else: else:
form = PaymentForm() form = PaymentForm()
@ -132,6 +138,8 @@ def payment_edit(request, pk):
payment = form.save(commit=False) payment = form.save(commit=False)
payment.user = request.user payment.user = request.user
payment.save() payment.save()
messages.success(request, 'Payment edited successfully')
return redirect('not_refunded_payments') return redirect('not_refunded_payments')
else: else:
form = PaymentForm(instance=payment) form = PaymentForm(instance=payment)