]> git.parisson.com Git - teleforma.git/commitdiff
Bug fix in XLS export of students
authorGael Le Mignot <gael@pilotsystems.net>
Thu, 15 Apr 2021 09:45:46 +0000 (11:45 +0200)
committerGael Le Mignot <gael@pilotsystems.net>
Thu, 15 Apr 2021 09:45:46 +0000 (11:45 +0200)
teleforma/views/crfpa.py

index d438ec07c092fcf89c3fbfaf9e71b60f45b90790..3aa08f6b31c38b77c00d8998375da46436310b5e 100644 (file)
@@ -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