diff --git a/passerelle_imio_extra_fees/models.py b/passerelle_imio_extra_fees/models.py index a460c0b..80d3dbc 100644 --- a/passerelle_imio_extra_fees/models.py +++ b/passerelle_imio_extra_fees/models.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -import json + from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models @@ -24,6 +24,7 @@ from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ from passerelle.base.models import BaseResource +from passerelle.compat import json_loads from passerelle.utils.api import endpoint from decimal import Decimal @@ -57,7 +58,7 @@ class ExtraFees(BaseResource): def default_compute(self, request, **kwargs): nb_documents = 0 nb_letter = 0 - data = json.loads(request.body.decode('utf-8')) + data = json_loads(request.body.decode('utf-8')) postage_fee = Decimal(self.belgium_postage_fee) for basket_item in data['data']: try: @@ -72,7 +73,7 @@ class ExtraFees(BaseResource): return {'data': [{'subject': force_text(_('Postage')), 'amount': str(postage_fee)}]} def namur_compute(self, request, **kwargs): - data = json.loads(request.body) + data = json_loads(request.body) # EXCEPTIONS : # duplicata-de-livret-de-mariage (frais port 8 ou 13) # demande-de-changement-d-adresse-domicile (frais port 0)