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):
|
||||
query_params = validated_data.get("query_data", {})
|
||||
|
||||
if not bool(query_params):
|
||||
raise serializers.ValidationError(
|
||||
{"query_data": ["Query data field cannot be empty"]}
|
||||
)
|
||||
|
||||
if bool(query_params):
|
||||
validated_data["query"] = issue_filters(query_params, "POST")
|
||||
else:
|
||||
validated_data["query"] = dict()
|
||||
return IssueView.objects.create(**validated_data)
|
||||
|
||||
def update(self, instance, validated_data):
|
||||
query_params = validated_data.get("query_data", {})
|
||||
if not bool(query_params):
|
||||
raise serializers.ValidationError(
|
||||
{"query_data": ["Query data field cannot be empty"]}
|
||||
)
|
||||
|
||||
if bool(query_params):
|
||||
validated_data["query"] = issue_filters(query_params, "POST")
|
||||
else:
|
||||
validated_data["query"] = dict()
|
||||
validated_data["query"] = issue_filters(query_params, "PATCH")
|
||||
return super().update(instance, validated_data)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user