Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon-groundlight committed Dec 12, 2024
1 parent 3fad243 commit 4af4671
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/groundlight/experimental_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ def list_detector_rules(self, detector: Union[str, Detector]) -> List[Rule]:
:param detector: the detector or detector_id to get the rules for
:return: a list of Rule objects associated with the given detector
"""
return [Rule.model_validate(rule.to_dict()) for rule in self.actions_api.list_detector_rules(detector.id)]
if isinstance(detector, Detector):
detector = detector.id
return [Rule.model_validate(rule.to_dict()) for rule in self.actions_api.list_detector_rules(detector)]

def delete_rule(self, action_id: int) -> None:
"""
Expand Down

0 comments on commit 4af4671

Please sign in to comment.