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 ...@@ -36,7 +36,7 @@ from django.db.models import Q
from astakos.quotaholder_app.exception import ( from astakos.quotaholder_app.exception import (
QuotaholderError, QuotaholderError,
NoCommissionError, NoCommissionError,
CorruptedError, InvalidDataError, CorruptedError,
NoHoldingError, NoHoldingError,
DuplicateError) DuplicateError)
...@@ -148,9 +148,6 @@ def issue_commission(clientkey, provisions, name="", force=False): ...@@ -148,9 +148,6 @@ def issue_commission(clientkey, provisions, name="", force=False):
try: try:
checked = [] checked = []
for key, quantity in provisions: for key, quantity in provisions:
if not isinstance(quantity, (int, long)):
raise InvalidDataError("Malformed provision")
if key in checked: if key in checked:
m = "Duplicate provision for %s" % str(key) m = "Duplicate provision for %s" % str(key)
provision = _mkProvision(key, quantity) provision = _mkProvision(key, quantity)
......
...@@ -37,7 +37,6 @@ from snf_django.utils.testing import assertGreater, assertIn, assertRaises ...@@ -37,7 +37,6 @@ from snf_django.utils.testing import assertGreater, assertIn, assertRaises
from astakos.quotaholder_app import models from astakos.quotaholder_app import models
import astakos.quotaholder_app.callpoint as qh import astakos.quotaholder_app.callpoint as qh
from astakos.quotaholder_app.exception import ( from astakos.quotaholder_app.exception import (
InvalidDataError,
NoCommissionError, NoCommissionError,
NoQuantityError, NoQuantityError,
NoCapacityError, NoCapacityError,
...@@ -151,10 +150,6 @@ class QuotaholderTest(TestCase): ...@@ -151,10 +150,6 @@ class QuotaholderTest(TestCase):
self.assertEqual(provision['resource'], resource1) self.assertEqual(provision['resource'], resource1)
self.assertEqual(provision['quantity'], 2) 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]) r = qh.get_quota(holders=[holder])
quotas = {(holder, source, resource1): (limit1, 0, limit1/2), quotas = {(holder, source, resource1): (limit1, 0, limit1/2),
(holder, source, resource2): (limit2, 0, limit2), (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