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