Skip to content

Commit

Permalink
[client] Enhance sighting import
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Sep 7, 2024
1 parent 93bb93c commit ea3f1d3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pycti/utils/opencti_stix2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2436,7 +2436,7 @@ def import_item(
if len(to_ids) > 0:
for to_id in to_ids:
self.import_sighting(item, from_id, to_id, update)
if (
elif (
self.opencti.get_attribute_in_extension("sighting_of_ref", item)
is not None
):
Expand All @@ -2446,10 +2446,11 @@ def import_item(
if len(to_ids) > 0:
for to_id in to_ids:
self.import_sighting(item, from_id, to_id, update)
from_id = item["sighting_of_ref"]
if len(to_ids) > 0:
for to_id in to_ids:
self.import_sighting(item, from_id, to_id, update)
else:
from_id = item["sighting_of_ref"]
if len(to_ids) > 0:
for to_id in to_ids:
self.import_sighting(item, from_id, to_id, update)
# Import observed_data_refs
if "observed_data_refs" in item:
for observed_data_ref in item["observed_data_refs"]:
Expand Down

0 comments on commit ea3f1d3

Please sign in to comment.