summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Boulanger <christophe.boulanger@imio.be>2017-09-13 11:44:42 (GMT)
committerChristophe Boulanger <christophe.boulanger@imio.be>2017-09-13 11:44:42 (GMT)
commit6d37e7809e7f64c6712f14fcee06d8e8e5232c93 (patch)
tree51e16be50305baa23b7f017ae9f751168baac3f5
parent319b4fb28a30c15add64d2954c2aab0e2693d1cb (diff)
downloadpasserelle-imio-extra-fees-6d37e7809e7f64c6712f14fcee06d8e8e5232c93.zip
passerelle-imio-extra-fees-6d37e7809e7f64c6712f14fcee06d8e8e5232c93.tar.gz
passerelle-imio-extra-fees-6d37e7809e7f64c6712f14fcee06d8e8e5232c93.tar.bz2
Refactoring...
-rw-r--r--passerelle_imio_extra_fees/models.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/passerelle_imio_extra_fees/models.py b/passerelle_imio_extra_fees/models.py
index fb0a7f4..8402ac2 100644
--- a/passerelle_imio_extra_fees/models.py
+++ b/passerelle_imio_extra_fees/models.py
@@ -36,13 +36,12 @@ class ExtraFees(BaseResource):
@endpoint(methods=['post'])
def compute(self, request, **kwargs):
data = json.loads(request.body)
-
+ max_doc_in_letter = 5
nb_documents = 0
+ nb_letter = 0
# Balaie chaque elem du panier.
for basket_item in data['data']:
- nb_letter = 0
postage_fee = Decimal('0.74')
- max_doc_in_letter = 5
try:
nb_documents += int(basket_item['request_data']['nb_documents'])
if Decimal(basket_item['request_data']['country_price']) > postage_fee: