forked from github/plane
dev: update issue webhook payload
This commit is contained in:
parent
5cbfd204fe
commit
b1c31866ca
@ -21,7 +21,8 @@ from plane.db.models import (
|
|||||||
from .base import BaseSerializer
|
from .base import BaseSerializer
|
||||||
from .cycle import CycleSerializer, CycleLiteSerializer
|
from .cycle import CycleSerializer, CycleLiteSerializer
|
||||||
from .module import ModuleSerializer, ModuleLiteSerializer
|
from .module import ModuleSerializer, ModuleLiteSerializer
|
||||||
|
from .user import UserLiteSerializer
|
||||||
|
from .state import StateLiteSerializer
|
||||||
|
|
||||||
class IssueSerializer(BaseSerializer):
|
class IssueSerializer(BaseSerializer):
|
||||||
assignees = serializers.ListField(
|
assignees = serializers.ListField(
|
||||||
@ -331,12 +332,23 @@ class ModuleIssueSerializer(BaseSerializer):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class IssueExpandSerializer(BaseSerializer):
|
class LabelLiteSerializer(BaseSerializer):
|
||||||
# Serialize the related cycle. It's a OneToOne relation.
|
|
||||||
cycle = CycleLiteSerializer(source="issue_cycle.cycle", read_only=True)
|
|
||||||
|
|
||||||
# Serialize the related module. It's a OneToOne relation.
|
class Meta:
|
||||||
|
model = Label
|
||||||
|
fields = [
|
||||||
|
"id",
|
||||||
|
"name",
|
||||||
|
"color",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class IssueExpandSerializer(BaseSerializer):
|
||||||
|
cycle = CycleLiteSerializer(source="issue_cycle.cycle", read_only=True)
|
||||||
module = ModuleLiteSerializer(source="issue_module.module", read_only=True)
|
module = ModuleLiteSerializer(source="issue_module.module", read_only=True)
|
||||||
|
labels = LabelLiteSerializer(read_only=True, many=True)
|
||||||
|
assignees = UserLiteSerializer(read_only=True, many=True)
|
||||||
|
state = StateLiteSerializer(read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Issue
|
model = Issue
|
||||||
@ -349,4 +361,4 @@ class IssueExpandSerializer(BaseSerializer):
|
|||||||
"updated_by",
|
"updated_by",
|
||||||
"created_at",
|
"created_at",
|
||||||
"updated_at",
|
"updated_at",
|
||||||
]
|
]
|
||||||
|
@ -11,10 +11,6 @@ class UserLiteSerializer(BaseSerializer):
|
|||||||
"first_name",
|
"first_name",
|
||||||
"last_name",
|
"last_name",
|
||||||
"avatar",
|
"avatar",
|
||||||
"is_bot",
|
|
||||||
"display_name",
|
"display_name",
|
||||||
]
|
]
|
||||||
read_only_fields = [
|
read_only_fields = fields
|
||||||
"id",
|
|
||||||
"is_bot",
|
|
||||||
]
|
|
Loading…
Reference in New Issue
Block a user