Added header row and public or not column (#512)
Also changed to show all numbers, and not only public ones, since this for adding to the phone system and all numbers need to be added
This commit is contained in:
parent
1c88ed8073
commit
944a42b597
|
@ -36,11 +36,24 @@ class DectExportView(
|
|||
"Content-Disposition"
|
||||
] = f'attachment; filename="{self.camp.slug}-dect-export-{timezone.now()}.csv"'
|
||||
writer = csv.writer(response)
|
||||
for dect in DectRegistration.objects.filter(
|
||||
camp=self.camp, publish_in_phonebook=True
|
||||
):
|
||||
writer.writerow(
|
||||
[
|
||||
"number",
|
||||
"letters",
|
||||
"description",
|
||||
"activation_code",
|
||||
"publish_in_phonebook",
|
||||
]
|
||||
)
|
||||
for dect in DectRegistration.objects.filter(camp=self.camp):
|
||||
writer.writerow(
|
||||
[dect.number, dect.letters, dect.description, dect.activation_code]
|
||||
[
|
||||
dect.number,
|
||||
dect.letters,
|
||||
dect.description,
|
||||
dect.activation_code,
|
||||
dect.publish_in_phonebook,
|
||||
]
|
||||
)
|
||||
return response
|
||||
|
||||
|
|
Loading…
Reference in a new issue