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: add timestamp to form export #704

Merged
merged 6 commits into from
Apr 8, 2020

Conversation

dodumosu
Copy link
Collaborator

@dodumosu dodumosu commented Apr 8, 2020

this commit addresses the issues of form exports being cached
by adding the UTC timestamp to the export filename.

see: nditech/apollo-issues#19

this commit addresses the issues of form exports being cached
by adding the UTC timestamp to the export filename.

see: nditech/apollo-issues#19
@dodumosu dodumosu requested a review from takinbo April 8, 2020 13:16
apollo/formsframework/views_forms.py Outdated Show resolved Hide resolved
@@ -407,7 +408,8 @@ def export_form(id):
workbook = utils.export_form(form)
workbook.save(memory_file)
memory_file.seek(0)
filename = '{}.xls'.format(form.name)
current_timestamp = datetime.utcnow()
filename = f'{form.name}-{current_timestamp:%Y %m %d %H%M%S}.xls'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will leave spaces in the filename which is not what we want.

apollo/formsframework/views_forms.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@takinbo takinbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@takinbo takinbo merged commit 1b1cddb into nditech:develop Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants