konto double send bug

This commit is contained in:
seba 2011-03-05 01:46:24 +01:00
parent 2348a8496c
commit 769619310e
3 changed files with 11 additions and 3 deletions

View File

@ -7,6 +7,7 @@ Noch zu tun:
[ ] API
[ ] Kassenwart-ueberweisung "ok" interface
[ ] Einstellungen (email bei ueberweisung,...?)
[ ] Ldap anbindung fuer login
Nice-to-haf:

View File

@ -2,7 +2,11 @@
{% block "content" %}
{% if transacted %}
<font color="green"><b>YOU DID IT!</b></font>. You transacted money!
{% if error %}
<font color="red"><b>ARGHZ</b></font>. U broakzt t3h formul4r!
{% else %}
<font color="green"><b>YOU DID IT!</b></font>. You transacted money!
{% endif %}
{% endif %}
<form method="POST" action="/transaction/">
{% csrf_token %}

View File

@ -10,7 +10,9 @@ import datetime
def overview(request):
history = Transaction.objects.filter(user=request.user).order_by("-dateTime")
transacted = False
error = False
if request.method == 'POST':
transacted = True
transaction = Transaction(user=request.user, dateTime=datetime.datetime.now())
form = TransactionForm(request.POST, instance=transaction)
if form.is_valid():
@ -18,10 +20,11 @@ def overview(request):
form = TransactionForm()
transacted = True
else:
pass
error = True
form = TransactionForm()
else:
form = TransactionForm()
return render_to_response("transaction/overview.html", {'history': history, 'form': form, 'transacted': transacted}, RequestContext(request))
return render_to_response("transaction/overview.html", {'history': history, 'form': form, 'transacted': transacted, 'error': error}, RequestContext(request))
@login_required
def transact(request):