From: Gael Le Mignot Date: Thu, 15 Apr 2021 09:45:46 +0000 (+0200) Subject: Bug fix in XLS export of students X-Git-Tag: 1.4.3~3^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6e76925ac9a6071a4a295d9dfdc835b2a779a1ad;p=teleforma.git Bug fix in XLS export of students --- diff --git a/teleforma/views/crfpa.py b/teleforma/views/crfpa.py index d438ec07..3aa08f6b 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -319,7 +319,12 @@ class UserXLSBook(object): value = payment['value'] month = payment['month'] ptype = payment['type'] - ptype_label = next((payment_choice[1] for payment_choice in payment_choices if payment_choice[0] == ptype), ['none']) + for payment_choice in payment_choices: + if payment_choice[0] == ptype: + ptype_label = payment_choice[1] + break + else: + ptype_label = 'none' total_payments += value if month in payment_per_month: payment_per_month[month]['amount'] += value