Skip to content

Commit ce23bae

Browse files
Merge pull request #3270 from antgonza/fix-3245
fix #3245
2 parents aff1548 + ec97a08 commit ce23bae

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

Diff for: qiita_core/tests/test_util.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ def test_get_release_info(self):
7272
biom_metadata_release, archive_release = get_release_info('private')
7373
# note that we are testing not equal as we should have some information
7474
# and then we will test that at least the 2nd element is correct
75-
self.assertNotEqual(biom_metadata_release, (b'', b'', b''))
75+
self.assertNotEqual(biom_metadata_release, ('', '', ''))
7676
self.assertEqual(biom_metadata_release[1],
77-
b'releases/QIITA-private.tgz')
78-
self.assertEqual(archive_release, (b'', b'', b''))
77+
'releases/QIITA-private.tgz')
78+
self.assertEqual(archive_release, ('', '', ''))
7979

8080
generate_plugin_releases()
8181
biom_metadata_release, archive_release = get_release_info('public')
82-
self.assertEqual(biom_metadata_release, (b'', b'', b''))
83-
self.assertNotEqual(archive_release, (b'', b'', b''))
82+
self.assertEqual(biom_metadata_release, ('', '', ''))
83+
self.assertNotEqual(archive_release, ('', '', ''))
8484

8585

8686
if __name__ == '__main__':

Diff for: qiita_core/util.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -135,25 +135,19 @@ def get_release_info(study_status='public'):
135135
timestamp = r_client.get('%s:release:%s:time' % (portal, study_status))
136136
# replacing None values for empty strings as the text is displayed nicely
137137
# in the GUI
138-
if md5sum is None:
139-
md5sum = b''
140-
if filepath is None:
141-
filepath = b''
142-
if timestamp is None:
143-
timestamp = b''
138+
md5sum = '' if md5sum is None else md5sum.decode('ascii')
139+
filepath = '' if filepath is None else filepath.decode('ascii')
140+
timestamp = '' if timestamp is None else timestamp.decode('ascii')
144141
biom_metadata_release = ((md5sum, filepath, timestamp))
145142

146143
md5sum = r_client.get('release-archive:md5sum')
147144
filepath = r_client.get('release-archive:filepath')
148145
timestamp = r_client.get('release-archive:time')
149146
# replacing None values for empty strings as the text is displayed nicely
150147
# in the GUI
151-
if md5sum is None:
152-
md5sum = b''
153-
if filepath is None:
154-
filepath = b''
155-
if timestamp is None:
156-
timestamp = b''
148+
md5sum = '' if md5sum is None else md5sum.decode('ascii')
149+
filepath = '' if filepath is None else filepath.decode('ascii')
150+
timestamp = '' if timestamp is None else timestamp.decode('ascii')
157151
archive_release = ((md5sum, filepath, timestamp))
158152

159153
return (biom_metadata_release, archive_release)

Diff for: qiita_pet/handlers/download.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def get(self, extras):
266266
self.set_header('Content-Type', 'application/octet-stream')
267267
self.set_header('Content-Transfer-Encoding', 'binary')
268268
self.set_header('X-Accel-Redirect',
269-
'/protected-working_dir/' + relpath.decode('ascii'))
269+
f'/protected-working_dir/{relpath}')
270270
self.finish()
271271

272272

0 commit comments

Comments
 (0)