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

[WIP]: Fix EDB download button #971

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions jwql/website/apps/jwql/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ def get_edb_components(request):
# save file locally to be available for download
static_dir = os.path.join(settings.BASE_DIR, 'static')
ensure_dir_exists(static_dir)
file_name_root = 'mnemonic_query_result_table'
file_name_root = f"{mnemonic_identifier}_{start_time.iso.split(' ')[0]}_{end_time.iso.split(' ')[0]}"
file_for_download = '{}.csv'.format(file_name_root)
path_for_download = os.path.join(static_dir, file_for_download)
path_to_save = os.path.join(static_dir, file_for_download)

# add meta data to saved table
comments = []
Expand All @@ -376,7 +376,7 @@ def get_edb_components(request):
comments.append('End time {}'.format(end_time.isot))
comments.append('Number of rows {}'.format(len(result_table)))
comments.append(' ')
result_table.write(path_for_download, format='ascii.fixed_width',
result_table.write(path_to_save, format='ascii.fixed_width',
overwrite=True, delimiter=',', bookend=False)
mnemonic_query_result.file_for_download = file_for_download

Expand Down