From 5c8c0b3e5c0171ddcf14f81ebd87ffb9cad195f2 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 5 May 2020 16:14:02 +0200 Subject: [PATCH] Fix join team --- apps/member/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/member/views.py b/apps/member/views.py index 4cbc4fb..75f6341 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -122,11 +122,11 @@ class JoinTeamView(LoginRequiredMixin, FormView): form.add_error('access_code', _("You are already in a team.")) return self.form_invalid(form) - if self.request.user.role == '2coach' and team.encadrants.size() == 3: + if self.request.user.role == '2coach' and len(team.encadrants) == 3: form.add_error('access_code', _("This team is full of coachs.")) return self.form_invalid(form) - if self.request.user.role == '3participant' and team.participants.size() == 5: + if self.request.user.role == '3participant' and len(team.participants.size()) == 5: form.add_error('access_code', _("This team is full of participants.")) return self.form_invalid(form)