mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
Merge pull request #1760 from makeplane/fix/project_member_invite
fix: project invite
This commit is contained in:
commit
78095e3823
@ -602,19 +602,29 @@ class AddMemberToProjectEndpoint(BaseAPIView):
|
|||||||
)
|
)
|
||||||
bulk_project_members = []
|
bulk_project_members = []
|
||||||
|
|
||||||
project_members = ProjectMember.objects.filter(
|
project_members = (
|
||||||
workspace=self.workspace, member_id__in=[member.get("member_id") for member in members]
|
ProjectMember.objects.filter(
|
||||||
).values("member_id").annotate(sort_order_min=Min("sort_order"))
|
workspace__slug=slug,
|
||||||
|
member_id__in=[member.get("member_id") for member in members],
|
||||||
|
)
|
||||||
|
.values("member_id", "sort_order")
|
||||||
|
.order_by("sort_order")
|
||||||
|
)
|
||||||
|
|
||||||
for member in members:
|
for member in members:
|
||||||
sort_order = [project_member.get("sort_order") for project_member in project_members]
|
sort_order = [
|
||||||
|
project_member.get("sort_order")
|
||||||
|
for project_member in project_members
|
||||||
|
if str(project_member.get("member_id"))
|
||||||
|
== str(member.get("member_id"))
|
||||||
|
]
|
||||||
bulk_project_members.append(
|
bulk_project_members.append(
|
||||||
ProjectMember(
|
ProjectMember(
|
||||||
member_id=member.get("member_id"),
|
member_id=member.get("member_id"),
|
||||||
role=member.get("role", 10),
|
role=member.get("role", 10),
|
||||||
project_id=project_id,
|
project_id=project_id,
|
||||||
workspace_id=project.workspace_id,
|
workspace_id=project.workspace_id,
|
||||||
sort_order=sort_order[0] - 10000 if len(sort_order) else 65535
|
sort_order=sort_order[0] - 10000 if len(sort_order) else 65535,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user