summaryrefslogtreecommitdiff
path: root/talerbank/app/schemas.py
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2017-11-03 17:05:41 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2017-11-03 17:05:41 +0100
commit5c876a276c7cc14d18751e22e90d8274e526da20 (patch)
tree84610412dadbf6f45d941422f1c880b0c32fdc46 /talerbank/app/schemas.py
parent505cbc42020eff1442d1a7f427299a49eea136db (diff)
downloadbank-5c876a276c7cc14d18751e22e90d8274e526da20.tar.gz
bank-5c876a276c7cc14d18751e22e90d8274e526da20.tar.bz2
bank-5c876a276c7cc14d18751e22e90d8274e526da20.zip
pylint
Diffstat (limited to 'talerbank/app/schemas.py')
-rw-r--r--talerbank/app/schemas.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/talerbank/app/schemas.py b/talerbank/app/schemas.py
index 91771d1..e43947d 100644
--- a/talerbank/app/schemas.py
+++ b/talerbank/app/schemas.py
@@ -20,9 +20,8 @@ definitions of JSON schemas for validating data
"""
import validictory
-from django.core.exceptions import ValidationError
-wiredetails_schema = {
+WIREDETAILS_SCHEMA = {
"type": "object",
"properties": {
"test": {
@@ -37,7 +36,7 @@ wiredetails_schema = {
}
}
-auth_schema = {
+AUTH_SCHEMA = {
"type": "object",
"properties": {
"type": {"type": "string"},
@@ -45,7 +44,7 @@ auth_schema = {
}
}
-amount_schema = {
+AMOUNT_SCHEMA = {
"type": "object",
"properties": {
"value": {"type": "integer"},
@@ -54,25 +53,22 @@ amount_schema = {
}
}
-incoming_request_schema = {
+INCOMING_REQUEST_SCHEMA = {
"type": "object",
"properties": {
- "amount": {"type": amount_schema},
+ "amount": {"type": AMOUNT_SCHEMA},
"wtid": {"type": "string"},
"exchange_url": {"type": "string"},
"credit_account": {"type": "integer"},
- "auth": auth_schema
+ "auth": AUTH_SCHEMA
}
}
def validate_amount(amount):
- validictory.validate(amount, amount_schema)
+ validictory.validate(amount, AMOUNT_SCHEMA)
def validate_wiredetails(wiredetails):
- validictory.validate(wiredetails, wiredetails_schema)
+ validictory.validate(wiredetails, WIREDETAILS_SCHEMA)
def validate_incoming_request(incoming_request):
- validictory.validate(incoming_request, incoming_request_schema)
-
-def validate_auth_basic(auth_basic):
- validictory.validate(auth_basic, auth_basic_schema)
+ validictory.validate(incoming_request, INCOMING_REQUEST_SCHEMA)