From f6088ef4952dc23e567f14467a3621f89d629328 Mon Sep 17 00:00:00 2001 From: Gael Le Mignot Date: Mon, 18 May 2020 10:51:46 +0200 Subject: [PATCH] Second hotfix for fake option Aucune --- teleforma/views/crfpa.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/teleforma/views/crfpa.py b/teleforma/views/crfpa.py index b463ddf4..7497970a 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -677,14 +677,16 @@ class ReceiptPDFView(PDFTemplateResponseMixin, TemplateView): period.date_begin.strftime('%d/%m/%Y'), period.date_end.strftime('%d/%m/%Y'),) - if student.oral_1: + oral_1 = student.oral_1 and student.oral_1.title != 'Aucune' + + if oral_1: substract += ORAL_OPTION_PRICE items.append({ 'label': label, 'unit_price': student.total_fees - substract - student.total_discount, 'amount': 1, 'discount': student.total_discount, }, ) - if student.oral_1 and student.oral_1.title != 'Aucune': + if oral_1: items.append({ 'label': "Option langue", 'unit_price': ORAL_OPTION_PRICE, 'amount': 1, -- 2.39.5