[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-bank] branch master updated: fix logic for /history
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-bank] branch master updated: fix logic for /history view selection to properly handle misc cornercases |
Date: |
Mon, 15 May 2017 20:33:33 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository bank.
The following commit(s) were added to refs/heads/master by this push:
new f22f3bd fix logic for /history view selection to properly handle misc
cornercases
f22f3bd is described below
commit f22f3bd974edc836bbe1b0f2a73784d1a61caa2d
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon May 15 20:33:31 2017 +0200
fix logic for /history view selection to properly handle misc cornercases
---
talerbank/app/views.py | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index bd6f583..a8e2e69 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -49,7 +49,7 @@ class SameAccountException(Exception):
pass
class MyAuthenticationForm(django.contrib.auth.forms.AuthenticationForm):
- def __init__(self, *args, **kwargs):
+ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["username"].widget.attrs["autofocus"] = True
self.fields["username"].widget.attrs["placeholder"] = "Username"
@@ -339,7 +339,7 @@ def history(request):
delta = request.GET.get("delta")
if not delta:
return HttpResponseBadRequest()
- #FIXME: make the '+' sign optional
+ #FIXME: make the '+' sign optional
parsed_delta = re.search("([\+-])?([0-9]+)", delta)
try:
parsed_delta.group(0)
@@ -353,15 +353,14 @@ def history(request):
sign = parsed_delta.group(1)
- if not start:
- sign = "-"
+ if ("+" == sign) or (not sign):
+ sign = ""
# Assuming Q() means 'true'
sign_filter = Q()
if "-" == sign and start:
sign_filter = Q(id__lt=start)
- elif ("+" == sign or not sign) and start:
+ elif "" == sign and start:
sign_filter = Q(id__gt=start)
- sign = ""
# direction (debit/credit)
direction = request.GET.get("direction")
@@ -408,7 +407,7 @@ def history(request):
def auth_and_login(request):
"""Return user instance after checking authentication
credentials, False if errors occur"""
-
+
auth_type = None
if "POST" == request.method:
data = json.loads(request.body.decode("utf-8"))
@@ -529,7 +528,7 @@ def wire_transfer(amount,
else:
credit_account.balance_obj =
amounts.amount_sub(credit_account.balance_obj,
amount)
-
+
# Check here if any account went beyond the allowed
# debit threshold.
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-bank] branch master updated: fix logic for /history view selection to properly handle misc cornercases,
gnunet <=