Fix: fix some API crashes (#10196)

This commit is contained in:
shamoon
2025-06-16 22:44:39 -07:00
committed by GitHub
parent de12023311
commit e4fd008441
6 changed files with 124 additions and 7 deletions

View File

@@ -1189,7 +1189,6 @@ class SavedViewSerializer(OwnedObjectSerializer):
"owner",
"permissions",
"user_can_change",
"set_permissions",
]
def validate(self, attrs):
@@ -1754,6 +1753,8 @@ class StoragePathSerializer(MatchingModelSerializer, OwnedObjectSerializer):
class UiSettingsViewSerializer(serializers.ModelSerializer):
settings = serializers.DictField(required=False, allow_null=True)
class Meta:
model = UiSettings
depth = 1
@@ -2020,8 +2021,9 @@ class WorkflowTriggerSerializer(serializers.ModelSerializer):
):
attrs["filter_path"] = None
trigger_type = attrs.get("type", getattr(self.instance, "type", None))
if (
attrs["type"] == WorkflowTrigger.WorkflowTriggerType.CONSUMPTION
trigger_type == WorkflowTrigger.WorkflowTriggerType.CONSUMPTION
and "filter_mailrule" not in attrs
and ("filter_filename" not in attrs or attrs["filter_filename"] is None)
and ("filter_path" not in attrs or attrs["filter_path"] is None)