summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--talerbank/app/views.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 62f76b1..d5ad6fe 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -425,7 +425,9 @@ def login_via_headers(view_func):
# 'delta': how many results are going to be extracted. If 'None'
# is given, no filter of this kind will be applied.
# 'start': a "id" indicating the first record to be returned.
-# If -1 is given, then the first record will be the youngest.
+# If -1 is given, then the first record will be the youngest
+# and 'delta' records will be returned, _regardless_ of the
+# 'sign' being passed.
# 'sign': (+|-) indicating that we want records younger|older
# than 'start'.
@@ -443,15 +445,11 @@ def query_history(bank_account, direction, delta, start, sign):
sign_filter = {
"+": Q(id__gt=start),
"-": Q(id__lt=start),
- "*": Q(),
- "x": not Q(),
}
# Handle special case.
- if start == -1: # can only retrieve older records.
- sign = "*"
- if sign == "+": # no result is younger than the youngest.
- sign = "x"
+ if start == -1: # return 'delta' youngest records.
+ sign = "+"
return BankTransaction.objects.filter(
direction_switch.get(direction),