From 3f4b81cd2d9d4e6265bc6387dee0177ad397d19c Mon Sep 17 00:00:00 2001 From: MJ Akbari Date: Sun, 22 Sep 2024 00:23:24 +0330 Subject: [PATCH] =?UTF-8?q?debug=20=DB=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- user/models.py | 4 ++-- user/views.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user/models.py b/user/models.py index e639ef7..d6abf36 100644 --- a/user/models.py +++ b/user/models.py @@ -57,8 +57,8 @@ def get_payment_state(self): query = core_models.EventService.objects.filter(**args) if query.exists(): return "COMPLETED" - else: - return "PENDING" + + return "PENDING" def member_count(self): return self.members.count() diff --git a/user/views.py b/user/views.py index 7375acb..7782598 100644 --- a/user/views.py +++ b/user/views.py @@ -469,11 +469,11 @@ def enroll(self, request): user = request.user team = request.user.team - if not team or team.state != 'AC': + if not team or team.state != 'AC' or team.members.count() < 2 or team.members.count() > 5: return self.set_response( error=f"this team is not accepted", status=406, - message=TEAM_NOT_ACCEPTED, + message="تیم مورد قبول نیست!", status_code=status.HTTP_406_NOT_ACCEPTABLE, ) if competition.get_remain_capacity() < team.members.count():