Skip to content
Snippets Groups Projects
Commit 1880ceb0 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-272: fixed concurrency

parent 4e103455
No related branches found
No related tags found
1 merge request!213Resolve TMSS-272
...@@ -27,7 +27,6 @@ def populate_schemas(schema_dir: str=None, templates_filename: str=None): ...@@ -27,7 +27,6 @@ def populate_schemas(schema_dir: str=None, templates_filename: str=None):
if templates_filename is None: if templates_filename is None:
templates_filename = 'templates.json' templates_filename = 'templates.json'
with TMSSsession.create_from_dbcreds_for_ldap() as client:
templates_filepath = os.path.join(schema_dir, templates_filename) templates_filepath = os.path.join(schema_dir, templates_filename)
logger.info("Reading templates in: %s", templates_filepath) logger.info("Reading templates in: %s", templates_filepath)
with open(templates_filepath) as templates_file: with open(templates_filepath) as templates_file:
...@@ -44,6 +43,7 @@ def populate_schemas(schema_dir: str=None, templates_filename: str=None): ...@@ -44,6 +43,7 @@ def populate_schemas(schema_dir: str=None, templates_filename: str=None):
description = template.pop('description', json_schema.get('description', '<no description>')) description = template.pop('description', json_schema.get('description', '<no description>'))
version = template.pop('version', '1') version = template.pop('version', '1')
with TMSSsession.create_from_dbcreds_for_ldap() as client:
if template_path == 'subtask_template' and 'type' in template: if template_path == 'subtask_template' and 'type' in template:
# override plain-text type by its url # override plain-text type by its url
template['type'] = client.get_path_as_json_object('subtask_type/'+template.pop('type'))['url'] template['type'] = client.get_path_as_json_object('subtask_type/'+template.pop('type'))['url']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment