Correction export. candidats

This commit is contained in:
Claude Paroz 2021-02-01 18:12:59 +01:00
parent a50bd6a5f2
commit 3c6d05e0e3

View file

@ -48,7 +48,7 @@ def export_candidates(modeladmin, request, queryset):
for cand in queryset.values_list(*export_fields.values()):
values = []
for value, field_name in zip(cand, export_fields.values()):
if value != '' and field_name in choice_fields:
if value != '' and value is not None and field_name in choice_fields:
value = choice_fields[field_name][value]
if field_name in boolean_fields:
value = 'Oui' if value else ''