From 030fc141f864c17457169af99db81eedb24919fa Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Mon, 30 Dec 2024 01:14:41 +0200 Subject: [PATCH] No need to retrieve or update a specific team member --- docker-app/qfieldcloud/core/urls.py | 4 ++-- docker-app/qfieldcloud/core/views/teams_views.py | 15 +-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/docker-app/qfieldcloud/core/urls.py b/docker-app/qfieldcloud/core/urls.py index 381ea0063..1ae88a8fc 100644 --- a/docker-app/qfieldcloud/core/urls.py +++ b/docker-app/qfieldcloud/core/urls.py @@ -113,7 +113,7 @@ ), path( "organizations//teams//members//", - teams_views.GetUpdateDestroyTeamMemberView.as_view(), - name="team_member_retrieve_update_destroy", + teams_views.DestroyTeamMemberView.as_view(), + name="team_member_destroy", ), ] diff --git a/docker-app/qfieldcloud/core/views/teams_views.py b/docker-app/qfieldcloud/core/views/teams_views.py index 425bea120..4850730d8 100644 --- a/docker-app/qfieldcloud/core/views/teams_views.py +++ b/docker-app/qfieldcloud/core/views/teams_views.py @@ -178,7 +178,7 @@ def perform_create(self, serializer: TeamSerializer) -> None: get=extend_schema(description="Retrieve, update, or delete a team member"), delete=extend_schema(description="Delete a team member"), ) -class GetUpdateDestroyTeamMemberView(generics.RetrieveDestroyAPIView): +class DestroyTeamMemberView(generics.DestroyAPIView): """ View to handle adding and listing team members. --> organizations//team//members/" """ @@ -217,19 +217,6 @@ def get_full_team_name(self) -> str: return Team.format_team_name(organization_name, team_name) - def perform_update(self, serializer: TeamMemberSerializer) -> None: - """ - Update logic for the team member. - """ - team_member = self.get_object() - new_username = self.request.data.get("member") - - user_member = team_member.member - user_member.username = new_username - user_member.save() - - serializer.save() - @extend_schema_view( get=extend_schema(description="List all members of a team"),