Skip to content

Commit

Permalink
Validate all, not just production
Browse files Browse the repository at this point in the history
  • Loading branch information
ljstella committed Nov 13, 2024
1 parent 9266898 commit 1a4ea93
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,7 @@ def ensureProperRBAConfig(self):
# NOTE: we ignore the type error around self.status because we are using Pydantic's
# use_enum_values configuration
# https://docs.pydantic.dev/latest/api/config/#pydantic.config.ConfigDict.populate_by_name
if self.status not in [DetectionStatus.production.value]: # type: ignore
return self


if self.deployment.alert_action.rba.enabled is False or self.deployment.alert_action.rba is None:
# confirm we don't have an RBA config
Expand Down Expand Up @@ -855,7 +854,7 @@ def ensureProperRBAConfig(self):
@model_validator(mode="after")
def search_rba_fields_exist_validate(self):
# Return immediately if RBA isn't required
if (self.deployment.alert_action.rba.enabled is False or self.deployment.alert_action.rba is None) or self.status != DetectionStatus.production.value: #type: ignore
if (self.deployment.alert_action.rba.enabled is False or self.deployment.alert_action.rba is None): #type: ignore
return self

# Raise error if RBA isn't present
Expand Down

0 comments on commit 1a4ea93

Please sign in to comment.