Skip to content

Commit

Permalink
fix 4.2 issue in one view
Browse files Browse the repository at this point in the history
  • Loading branch information
freyamade committed Oct 22, 2024
1 parent c7a140d commit c7f7e4e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/api/views/team_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ def delete(self, request: Request, team_id: str, pk: id) -> Response:
except (TeamMember.DoesNotExist, ValidationError):
return Response(status=404)

team = obj.team

# Check permissions and kick status - Request is valid if;
# - Anyone with the Proxy Manager permission is kicking a proxy
# - The Team Leader is kicking someone *else* from the Team.
Expand Down Expand Up @@ -136,8 +134,8 @@ def delete(self, request: Request, team_id: str, pk: id) -> Response:
obj.team.remove_character(obj.character, kick)

# Websocket stuff
self._send_to_team(team, {'type': 'team', 'id': str(team.id), 'invite_code': str(team.invite_code)})
for tm in team.members.all():
self._send_to_team(obj.team, {'type': 'team', 'id': str(obj.team.id), 'invite_code': str(obj.team.invite_code)})
for tm in TeamMember.objects.filter(team_id=team_id).select_related('character', 'character__user'):
self._send_to_user(tm.character.user, {'type': 'character', 'id': tm.character.pk})

# Special handling for Proxy characters, we should delete them here
Expand Down

0 comments on commit c7f7e4e

Please sign in to comment.