forked from github/plane
chore: remove view filter validation while creating or updating view (#836)
This commit is contained in:
parent
5a36a7931f
commit
61761fedc5
@ -25,22 +25,18 @@ class IssueViewSerializer(BaseSerializer):
|
|||||||
|
|
||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
query_params = validated_data.get("query_data", {})
|
query_params = validated_data.get("query_data", {})
|
||||||
|
if bool(query_params):
|
||||||
if not bool(query_params):
|
validated_data["query"] = issue_filters(query_params, "POST")
|
||||||
raise serializers.ValidationError(
|
else:
|
||||||
{"query_data": ["Query data field cannot be empty"]}
|
validated_data["query"] = dict()
|
||||||
)
|
|
||||||
|
|
||||||
validated_data["query"] = issue_filters(query_params, "POST")
|
|
||||||
return IssueView.objects.create(**validated_data)
|
return IssueView.objects.create(**validated_data)
|
||||||
|
|
||||||
def update(self, instance, validated_data):
|
def update(self, instance, validated_data):
|
||||||
query_params = validated_data.get("query_data", {})
|
query_params = validated_data.get("query_data", {})
|
||||||
if not bool(query_params):
|
if bool(query_params):
|
||||||
raise serializers.ValidationError(
|
validated_data["query"] = issue_filters(query_params, "POST")
|
||||||
{"query_data": ["Query data field cannot be empty"]}
|
else:
|
||||||
)
|
validated_data["query"] = dict()
|
||||||
|
|
||||||
validated_data["query"] = issue_filters(query_params, "PATCH")
|
validated_data["query"] = issue_filters(query_params, "PATCH")
|
||||||
return super().update(instance, validated_data)
|
return super().update(instance, validated_data)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user