diff --git a/app/objects/c_source.py b/app/objects/c_source.py index f8dd33624..f0df44a0e 100644 --- a/app/objects/c_source.py +++ b/app/objects/c_source.py @@ -60,17 +60,15 @@ def _fix_loaded_object_origins(input_data): :param input_data: A 'source' dictionary :return: input_data with updated facts/relationships (patched in place) """ - if 'facts' in input_data: - for y in input_data['facts']: - y['origin_type'] = OriginType.IMPORTED.name - y['source'] = input_data['id'] - if 'relationships' in input_data: - for y in input_data['relationships']: - y['source']['origin_type'] = OriginType.IMPORTED.name - y['source']['source'] = input_data['id'] - if 'target' in y: - y['target']['origin_type'] = OriginType.IMPORTED.name - y['target']['source'] = input_data['id'] + for y in input_data.get('facts', []): + y['origin_type'] = OriginType.IMPORTED.name + y['source'] = input_data['id'] + for y in input_data.get('relationships', []): + y['source']['origin_type'] = OriginType.IMPORTED.name + y['source']['source'] = input_data['id'] + if y.get('target'): + y['target']['origin_type'] = OriginType.IMPORTED.name + y['target']['source'] = input_data['id'] class Source(FirstClassObjectInterface, BaseObject): diff --git a/requirements.txt b/requirements.txt index 2b42ee9a5..16a9577d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ jinja2==3.1.2 pyyaml==6.0.1 cryptography==41.0.3 websockets==11.0.3 -Sphinx==7.2.5 +Sphinx==7.1.2 sphinx_rtd_theme==1.3.0 myst-parser==2.0.0 marshmallow==3.20.1