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 [ ] API
[ ] Kassenwart-ueberweisung "ok" interface [ ] Kassenwart-ueberweisung "ok" interface
[ ] Einstellungen (email bei ueberweisung,...?) [ ] Einstellungen (email bei ueberweisung,...?)
[ ] Ldap anbindung fuer login
Nice-to-haf: Nice-to-haf:

View File

@ -2,7 +2,11 @@
{% block "content" %} {% block "content" %}
{% if transacted %} {% 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 %} {% endif %}
<form method="POST" action="/transaction/"> <form method="POST" action="/transaction/">
{% csrf_token %} {% csrf_token %}

View File

@ -10,7 +10,9 @@ import datetime
def overview(request): def overview(request):
history = Transaction.objects.filter(user=request.user).order_by("-dateTime") history = Transaction.objects.filter(user=request.user).order_by("-dateTime")
transacted = False transacted = False
error = False
if request.method == 'POST': if request.method == 'POST':
transacted = True
transaction = Transaction(user=request.user, dateTime=datetime.datetime.now()) transaction = Transaction(user=request.user, dateTime=datetime.datetime.now())
form = TransactionForm(request.POST, instance=transaction) form = TransactionForm(request.POST, instance=transaction)
if form.is_valid(): if form.is_valid():
@ -18,10 +20,11 @@ def overview(request):
form = TransactionForm() form = TransactionForm()
transacted = True transacted = True
else: else:
pass error = True
form = TransactionForm()
else: else:
form = TransactionForm() 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 @login_required
def transact(request): def transact(request):