Skip to content

Commit

Permalink
[client] prevent export list from ordering by _score (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyCloarec authored Sep 24, 2024
1 parent 3f6fbb4 commit c07c61f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pycti/utils/opencti_stix2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,12 @@ def export_entities_list(
do_list = lister.get(
entity_type, lambda **kwargs: self.unknown_type({"type": entity_type})
)

if getAll and (orderBy is None or orderBy == "_score"):
orderBy = "created_at"
if orderMode is None:
orderMode = "desc"

# noinspection PyTypeChecker
return do_list(
search=search,
Expand Down

0 comments on commit c07c61f

Please sign in to comment.