mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: deploy board status for project (#1866)
This commit is contained in:
parent
07717e9a93
commit
b554087b1f
@ -103,6 +103,7 @@ class ProjectDetailSerializer(BaseSerializer):
|
|||||||
is_member = serializers.BooleanField(read_only=True)
|
is_member = serializers.BooleanField(read_only=True)
|
||||||
sort_order = serializers.FloatField(read_only=True)
|
sort_order = serializers.FloatField(read_only=True)
|
||||||
member_role = serializers.IntegerField(read_only=True)
|
member_role = serializers.IntegerField(read_only=True)
|
||||||
|
is_deployed = serializers.BooleanField(read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Project
|
model = Project
|
||||||
|
@ -145,6 +145,14 @@ class ProjectViewSet(BaseViewSet):
|
|||||||
member_id=self.request.user.id,
|
member_id=self.request.user.id,
|
||||||
).values("role")
|
).values("role")
|
||||||
)
|
)
|
||||||
|
.annotate(
|
||||||
|
is_deployed=Exists(
|
||||||
|
ProjectDeployBoard.objects.filter(
|
||||||
|
project_id=OuterRef("pk"),
|
||||||
|
workspace__slug=self.kwargs.get("slug"),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
.distinct()
|
.distinct()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -216,7 +224,9 @@ class ProjectViewSet(BaseViewSet):
|
|||||||
project_id=serializer.data["id"], member=request.user, role=20
|
project_id=serializer.data["id"], member=request.user, role=20
|
||||||
)
|
)
|
||||||
|
|
||||||
if serializer.data["project_lead"] is not None and str(serializer.data["project_lead"]) != str(request.user.id):
|
if serializer.data["project_lead"] is not None and str(
|
||||||
|
serializer.data["project_lead"]
|
||||||
|
) != str(request.user.id):
|
||||||
ProjectMember.objects.create(
|
ProjectMember.objects.create(
|
||||||
project_id=serializer.data["id"],
|
project_id=serializer.data["id"],
|
||||||
member_id=serializer.data["project_lead"],
|
member_id=serializer.data["project_lead"],
|
||||||
|
Loading…
Reference in New Issue
Block a user