[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-bank] branch master updated: mentioning bad json fie
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-bank] branch master updated: mentioning bad json field in error message of /admin/add/incoming |
Date: |
Tue, 09 May 2017 22:26:30 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository bank.
The following commit(s) were added to refs/heads/master by this push:
new 9e25a68 mentioning bad json field in error message of
/admin/add/incoming
9e25a68 is described below
commit 9e25a685b2e82ca6c4ee6a060a6eedcf0eec4bbc
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue May 9 22:25:46 2017 +0200
mentioning bad json field in error message of /admin/add/incoming
---
talerbank/app/views.py | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 2ba00b4..f47d614 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -427,9 +427,9 @@ def auth_and_login(request):
username = request.META.get("HTTP_X_TALER_BANK_USERNAME")
password = request.META.get("HTTP_X_TALER_BANK_PASSWORD")
+ logger.info("Trying to log '%s/%s' in" % (username, password))
if not username or not password:
return False
-
return django.contrib.auth.authenticate(username=username,
password=password)
@@ -448,19 +448,15 @@ def add_incoming(request):
subject = "%s %s" % (data["wtid"], data["exchange_url"])
try:
schemas.validate_incoming_request(data)
- except ValueError:
- logger.error("Bad data POSTed")
- return JsonResponse(dict(error="invalid POSTed data"), status=400)
+ except ValueError as error:
+ logger.error("Bad data POSTed: %s" % error)
+ return JsonResponse(dict(error="invalid data POSTed: %s" % error),
status=400)
- # FIXME, in the bank's current state, the debit account is
- # always the one of the authenticated user; for future releases,
- # the debit account should be specified too, as one user may
- # have multiple accounts at the same bank.
user_account = auth_and_login(request)
if not user_account:
return JsonResponse(dict(error="authentication failed"),
- status=401)
+ status=401)
try:
credit_account = BankAccount.objects.get(user=data["credit_account"])
--
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: mentioning bad json field in error message of /admin/add/incoming,
gnunet <=