Skip to content

Commit

Permalink
Merge pull request #241 from uw-it-aca/fix/metadata-upload
Browse files Browse the repository at this point in the history
Fix/metadata upload
  • Loading branch information
devights authored Jan 23, 2024
2 parents c4a2542 + ff6ea69 commit 0a937b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_metadata_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_post(self, mock_upload_to_gcs_bucket):
mock_upload_to_gcs_bucket.assert_called_once_with(
'application_metadata/predicted_probabilites/'
'2021-autumn-pred-proba.csv',
mock_content.read())
mock_content.read().split())
self.assertEqual(response.status_code,
200)
self.assertEqual(response.content,
Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/views/api/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def post(self, request, *args, **kwargs):
dao = BaseDAO()
new_file_name = request.POST["newFileName"]
url_key = self.get_full_file_path(new_file_name)
content = request.FILES['upload'].read()
content = request.FILES['upload'].read().split('\r\n')
dao.upload_to_gcs_bucket(url_key, content)
return self.json_response(content={"uploaded": True})
except Exception as e:
Expand Down

0 comments on commit 0a937b9

Please sign in to comment.