mirror of
https://github.com/BillyOutlast/posthog.git
synced 2026-02-04 03:01:23 +01:00
fix(flags): Added if check and return error for filters with empty groups fix#38896 (#39110)
Co-authored-by: SudeshHirave <sphirave@users.noreply.github.com> Co-authored-by: Gustavo H. Strassburger <gustavo@posthog.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
@@ -401,6 +401,12 @@ class FeatureFlagSerializer(
|
||||
# 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):
|
||||
|
||||
Reference in New Issue
Block a user