forked from github/plane
fix: project member list endpoint n+1 (#1458)
This commit is contained in:
parent
54a536e268
commit
e23e9ccdbb
@ -77,6 +77,13 @@ class ProjectSerializer(BaseSerializer):
|
|||||||
raise serializers.ValidationError(detail="Project Identifier is already taken")
|
raise serializers.ValidationError(detail="Project Identifier is already taken")
|
||||||
|
|
||||||
|
|
||||||
|
class ProjectLiteSerializer(BaseSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = Project
|
||||||
|
fields = ["id", "identifier", "name"]
|
||||||
|
read_only_fields = fields
|
||||||
|
|
||||||
|
|
||||||
class ProjectDetailSerializer(BaseSerializer):
|
class ProjectDetailSerializer(BaseSerializer):
|
||||||
workspace = WorkSpaceSerializer(read_only=True)
|
workspace = WorkSpaceSerializer(read_only=True)
|
||||||
default_assignee = UserLiteSerializer(read_only=True)
|
default_assignee = UserLiteSerializer(read_only=True)
|
||||||
@ -94,7 +101,7 @@ class ProjectDetailSerializer(BaseSerializer):
|
|||||||
|
|
||||||
class ProjectMemberSerializer(BaseSerializer):
|
class ProjectMemberSerializer(BaseSerializer):
|
||||||
workspace = WorkSpaceSerializer(read_only=True)
|
workspace = WorkSpaceSerializer(read_only=True)
|
||||||
project = ProjectSerializer(read_only=True)
|
project = ProjectLiteSerializer(read_only=True)
|
||||||
member = UserLiteSerializer(read_only=True)
|
member = UserLiteSerializer(read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
@ -127,10 +134,3 @@ class ProjectFavoriteSerializer(BaseSerializer):
|
|||||||
"workspace",
|
"workspace",
|
||||||
"user",
|
"user",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class ProjectLiteSerializer(BaseSerializer):
|
|
||||||
class Meta:
|
|
||||||
model = Project
|
|
||||||
fields = ["id", "identifier", "name"]
|
|
||||||
read_only_fields = fields
|
|
||||||
|
Loading…
Reference in New Issue
Block a user