Commit 38855659 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

quotaholder: Do not check provision integrity

The API is responsible to provide valid data to the backend.
parent 7ee2acd3
......@@ -36,7 +36,7 @@ from django.db.models import Q
from astakos.quotaholder_app.exception import (
QuotaholderError,
NoCommissionError,
CorruptedError, InvalidDataError,
CorruptedError,
NoHoldingError,
DuplicateError)
......@@ -148,9 +148,6 @@ def issue_commission(clientkey, provisions, name="", force=False):
try:
checked = []
for key, quantity in provisions:
if not isinstance(quantity, (int, long)):
raise InvalidDataError("Malformed provision")
if key in checked:
m = "Duplicate provision for %s" % str(key)
provision = _mkProvision(key, quantity)
......
......@@ -37,7 +37,6 @@ from snf_django.utils.testing import assertGreater, assertIn, assertRaises
from astakos.quotaholder_app import models
import astakos.quotaholder_app.callpoint as qh
from astakos.quotaholder_app.exception import (
InvalidDataError,
NoCommissionError,
NoQuantityError,
NoCapacityError,
......@@ -151,10 +150,6 @@ class QuotaholderTest(TestCase):
self.assertEqual(provision['resource'], resource1)
self.assertEqual(provision['quantity'], 2)
with assertRaises(InvalidDataError):
self.issue_commission([((holder, source, resource1), 1),
((holder, source, resource1), "nan")])
r = qh.get_quota(holders=[holder])
quotas = {(holder, source, resource1): (limit1, 0, limit1/2),
(holder, source, resource2): (limit2, 0, limit2),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment