Skip to content

Commit

Permalink
[client] Sightings remove resolution in client
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Sep 10, 2024
1 parent 2415854 commit bf9aeb9
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions pycti/utils/opencti_stix2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,37 +1315,9 @@ def import_sighting(

# Create the sighting

### Get the FROM
if from_id in self.mapping_cache:
final_from_id = self.mapping_cache[from_id]["id"]
else:
stix_object_result = (
self.opencti.opencti_stix_object_or_stix_relationship.read(id=from_id)
)
if stix_object_result is not None:
final_from_id = stix_object_result["id"]
else:
self.opencti.app_logger.error(
"From ref of the sighting not found, doing nothing..."
)
return None
final_from_id = from_id
final_to_id = to_id

### Get the TO
final_to_id = None
if to_id:
if to_id in self.mapping_cache:
final_to_id = self.mapping_cache[to_id]["id"]
else:
stix_object_result = (
self.opencti.opencti_stix_object_or_stix_relationship.read(id=to_id)
)
if stix_object_result is not None:
final_to_id = stix_object_result["id"]
else:
self.opencti.app_logger.error(
"To ref of the sighting not found, doing nothing..."
)
return None
if (
"x_opencti_negative" not in stix_sighting
and self.opencti.get_attribute_in_extension("negative", stix_sighting)
Expand Down

0 comments on commit bf9aeb9

Please sign in to comment.