Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1390 show person.created_at in subscriber csv export #1391

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion subscribie/blueprints/admin/export_subscribers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ def export_subscribers():
for subscription in subscriptions:
if subscription.person is not None:
person = {
"person_created_at_date": subscription.person.created_at.strftime(
"%d-%m-%Y"
), # noqa: E501
"person_created_at_time": subscription.person.created_at.strftime(
"%H:%M"
), # noqa: E501
"given_name": subscription.person.given_name,
"family_name": subscription.person.family_name,
"email": subscription.person.email,
Expand All @@ -44,7 +50,7 @@ def export_subscribers():

outfile = io.StringIO()
outcsv = csv.DictWriter(
outfile, fieldnames=list(all_fieldnames), extrasaction="ignore"
outfile, fieldnames=list(sorted(all_fieldnames)), extrasaction="ignore"
)
outcsv.writeheader()
for subscriber in subscribers:
Expand Down
Loading