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

Commit bf9aeb9

Browse files
committed
[client] Sightings remove resolution in client
1 parent 2415854 commit bf9aeb9

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,37 +1315,9 @@ def import_sighting(
13151315

13161316
# Create the sighting
13171317

1318-
### Get the FROM
1319-
if from_id in self.mapping_cache:
1320-
final_from_id = self.mapping_cache[from_id]["id"]
1321-
else:
1322-
stix_object_result = (
1323-
self.opencti.opencti_stix_object_or_stix_relationship.read(id=from_id)
1324-
)
1325-
if stix_object_result is not None:
1326-
final_from_id = stix_object_result["id"]
1327-
else:
1328-
self.opencti.app_logger.error(
1329-
"From ref of the sighting not found, doing nothing..."
1330-
)
1331-
return None
1318+
final_from_id = from_id
1319+
final_to_id = to_id
13321320

1333-
### Get the TO
1334-
final_to_id = None
1335-
if to_id:
1336-
if to_id in self.mapping_cache:
1337-
final_to_id = self.mapping_cache[to_id]["id"]
1338-
else:
1339-
stix_object_result = (
1340-
self.opencti.opencti_stix_object_or_stix_relationship.read(id=to_id)
1341-
)
1342-
if stix_object_result is not None:
1343-
final_to_id = stix_object_result["id"]
1344-
else:
1345-
self.opencti.app_logger.error(
1346-
"To ref of the sighting not found, doing nothing..."
1347-
)
1348-
return None
13491321
if (
13501322
"x_opencti_negative" not in stix_sighting
13511323
and self.opencti.get_attribute_in_extension("negative", stix_sighting)

0 commit comments

Comments
 (0)