Skip to content
Snippets Groups Projects
Commit f7b3a59b authored by Megan Henning's avatar Megan Henning
Browse files

Fix session template bugs

parent 6d7049a0
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ def is_session_compliant(session, template):
elif isinstance(cont_v, list):
found_in_list = False
for v in cont_v:
if re.search(req_v, cont_v, re.IGNORECASE):
if re.search(req_v, v, re.IGNORECASE):
found_in_list = True
break
if not found_in_list:
......
......@@ -5,6 +5,7 @@ import copy
import dateutil.parser
import json
import logging
import re
import sys
from api import config
......@@ -548,11 +549,13 @@ def upgrade_to_21():
new_a = {'minimum': a['minimum']}
properties = a['schema']['properties']
if 'measurement' in properties:
m_req = properties.pop('measurement')
m_req = properties['measurement']['pattern']
m_req = re.sub('^\(\?i\)', '', m_req)
new_a['files']=[{'measurement': m_req['pattern'], 'minimum': 1}]
if 'label' in properties:
l_req = properties.pop('label')
new_a['label'] = l_req['pattern']
l_req = properties['label']['pattern']
l_req = re.sub('^\(\?i\)', '', m_req)
new_a['label'] = l_req
new_template['acquisitions'].append(new_a)
return new_template
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment