Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit ea3f1d3

Browse files
committed
[client] Enhance sighting import
1 parent 93bb93c commit ea3f1d3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,7 +2436,7 @@ def import_item(
24362436
if len(to_ids) > 0:
24372437
for to_id in to_ids:
24382438
self.import_sighting(item, from_id, to_id, update)
2439-
if (
2439+
elif (
24402440
self.opencti.get_attribute_in_extension("sighting_of_ref", item)
24412441
is not None
24422442
):
@@ -2446,10 +2446,11 @@ def import_item(
24462446
if len(to_ids) > 0:
24472447
for to_id in to_ids:
24482448
self.import_sighting(item, from_id, to_id, update)
2449-
from_id = item["sighting_of_ref"]
2450-
if len(to_ids) > 0:
2451-
for to_id in to_ids:
2452-
self.import_sighting(item, from_id, to_id, update)
2449+
else:
2450+
from_id = item["sighting_of_ref"]
2451+
if len(to_ids) > 0:
2452+
for to_id in to_ids:
2453+
self.import_sighting(item, from_id, to_id, update)
24532454
# Import observed_data_refs
24542455
if "observed_data_refs" in item:
24552456
for observed_data_ref in item["observed_data_refs"]:

0 commit comments

Comments
 (0)