Intitial teams support #147
@ -22,6 +22,7 @@ class LeaveTeamView(LoginRequiredMixin, DetailView):
|
|||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
team = self.get_object()
|
team = self.get_object()
|
||||||
team_user = TeamsUsers.objects.filter(team=team, user=self.request.user).first()
|
team_user = TeamsUsers.objects.filter(team=team, user=self.request.user).first()
|
||||||
|
if team_user:
|
||||||
team_user.delete()
|
team_user.delete()
|
||||||
return redirect('teams:list')
|
return redirect('teams:list')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user