Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions posthog/api/feature_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,12 @@ def validate_filters(self, filters):
# mypy cannot tell that self.instance is a FeatureFlag
return self.instance.filters

groups = filters.get("groups", [])
if isinstance(groups, list) and len(groups) == 0:
raise serializers.ValidationError(
"Feature flag filters must contain at least one condition set. Empty 'groups' array is not allowed."
)

aggregation_group_type_index = filters.get("aggregation_group_type_index", None)

def properties_all_match(predicate):
Expand Down
Loading