Skip to content

fix #3245 #3270

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

Merged
merged 2 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions qiita_core/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ def test_get_release_info(self):
biom_metadata_release, archive_release = get_release_info('private')
# note that we are testing not equal as we should have some information
# and then we will test that at least the 2nd element is correct
self.assertNotEqual(biom_metadata_release, (b'', b'', b''))
self.assertNotEqual(biom_metadata_release, ('', '', ''))
self.assertEqual(biom_metadata_release[1],
b'releases/QIITA-private.tgz')
self.assertEqual(archive_release, (b'', b'', b''))
'releases/QIITA-private.tgz')
self.assertEqual(archive_release, ('', '', ''))

generate_plugin_releases()
biom_metadata_release, archive_release = get_release_info('public')
self.assertEqual(biom_metadata_release, (b'', b'', b''))
self.assertNotEqual(archive_release, (b'', b'', b''))
self.assertEqual(biom_metadata_release, ('', '', ''))
self.assertNotEqual(archive_release, ('', '', ''))


if __name__ == '__main__':
Expand Down
18 changes: 6 additions & 12 deletions qiita_core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,25 +135,19 @@ def get_release_info(study_status='public'):
timestamp = r_client.get('%s:release:%s:time' % (portal, study_status))
# replacing None values for empty strings as the text is displayed nicely
# in the GUI
if md5sum is None:
md5sum = b''
if filepath is None:
filepath = b''
if timestamp is None:
timestamp = b''
md5sum = '' if md5sum is None else md5sum.decode('ascii')
filepath = '' if filepath is None else filepath.decode('ascii')
timestamp = '' if timestamp is None else timestamp.decode('ascii')
biom_metadata_release = ((md5sum, filepath, timestamp))

md5sum = r_client.get('release-archive:md5sum')
filepath = r_client.get('release-archive:filepath')
timestamp = r_client.get('release-archive:time')
# replacing None values for empty strings as the text is displayed nicely
# in the GUI
if md5sum is None:
md5sum = b''
if filepath is None:
filepath = b''
if timestamp is None:
timestamp = b''
md5sum = '' if md5sum is None else md5sum.decode('ascii')
filepath = '' if filepath is None else filepath.decode('ascii')
timestamp = '' if timestamp is None else timestamp.decode('ascii')
archive_release = ((md5sum, filepath, timestamp))

return (biom_metadata_release, archive_release)
2 changes: 1 addition & 1 deletion qiita_pet/handlers/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def get(self, extras):
self.set_header('Content-Type', 'application/octet-stream')
self.set_header('Content-Transfer-Encoding', 'binary')
self.set_header('X-Accel-Redirect',
'/protected-working_dir/' + relpath.decode('ascii'))
f'/protected-working_dir/{relpath}')
self.finish()


Expand Down