Skip to content

Commit

Permalink
Load JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
adelavega committed Oct 13, 2021
1 parent ae7bccc commit 42e0943
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion neuroscout/resources/analysis/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
from hashids import Hashids
from webargs import fields
from sqlalchemy import desc
from marshmallow import INCLUDE, Schema
from marshmallow import INCLUDE, Schema, pre_load
from flask_apispec import doc, use_kwargs, MethodResource, marshal_with
from flask import current_app
from pathlib import Path
from pynv import Client
import json

from ...models import Report, NeurovaultCollection, NeurovaultFileUpload
from ...database import db
Expand Down Expand Up @@ -197,6 +198,12 @@ class NVUploadFormSchema(Schema):
class Meta:
unknown = INCLUDE

@pre_load
def json_load(self, args, **kwargs):
if 'cli_args' in args:
args['cli_args'] = json.load(args['cli_args'])
return args


class NVUploadFileSchema(Schema):
image_file = FileField(required=True)
Expand Down

0 comments on commit 42e0943

Please sign in to comment.