mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
Merge branch 'refactor/publish-project' of https://github.com/makeplane/plane into refactor/publish-project
This commit is contained in:
commit
3ca3561c89
@ -114,7 +114,7 @@ class ProjectListSerializer(DynamicBaseSerializer):
|
|||||||
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)
|
anchor = serializers.CharField(read_only=True)
|
||||||
members = serializers.SerializerMethodField()
|
members = serializers.SerializerMethodField()
|
||||||
|
|
||||||
def get_members(self, obj):
|
def get_members(self, obj):
|
||||||
@ -148,7 +148,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)
|
anchor = serializers.CharField(read_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Project
|
model = Project
|
||||||
|
@ -137,12 +137,11 @@ class ProjectViewSet(BaseViewSet):
|
|||||||
).values("role")
|
).values("role")
|
||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
is_deployed=Exists(
|
anchor=DeployBoard.objects.filter(
|
||||||
DeployBoard.objects.filter(
|
entity_name="project",
|
||||||
project_id=OuterRef("pk"),
|
entity_identifier=OuterRef("pk"),
|
||||||
workspace__slug=self.kwargs.get("slug"),
|
workspace__slug=self.kwargs.get("slug"),
|
||||||
)
|
).values("anchor")
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.annotate(sort_order=Subquery(sort_order))
|
.annotate(sort_order=Subquery(sort_order))
|
||||||
.prefetch_related(
|
.prefetch_related(
|
||||||
|
Loading…
Reference in New Issue
Block a user