Skip to content

Commit

Permalink
Merge pull request #634 from neuroscout/fix/coll_desc
Browse files Browse the repository at this point in the history
Use json string for collection description
  • Loading branch information
adelavega committed Aug 4, 2019
2 parents 82fcdd2 + 5696cd8 commit 00b677e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion neuroscout/resources/predictor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import webargs as wa
import tempfile
import json
from sqlalchemy import func
from flask_apispec import MethodResource, marshal_with, use_kwargs, doc
from flask_jwt import current_identity
Expand Down Expand Up @@ -133,11 +134,13 @@ class PredictorCollectionResource(MethodResource):
required=True
),
"dataset_id": wa.fields.Int(required=True, description="Dataset id."),
"descriptions": wa.fields.Dict(description="Column descriptions")
"descriptions": wa.fields.Str(description="Column descriptions")
}, locations=["files", "form"])
@auth_required
def post(self, collection_name, event_files, runs, dataset_id,
descriptions=None):
if descriptions is not None:
descriptions = json.loads(descriptions)
pc, filenames = prepare_upload(
collection_name, event_files, runs, dataset_id)

Expand Down
2 changes: 1 addition & 1 deletion neuroscout/tests/api/test_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_predictor_create(session,
assert results['status'] == 'OK'

resp = auth_client.get('/api/predictors/collection',
params={'id': pc.id})
params={'collection_id': pc.id})
assert resp.status_code == 200
resp = decode_json(resp)

Expand Down

0 comments on commit 00b677e

Please sign in to comment.