diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 77c05d1..571c45b 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -1120,6 +1120,7 @@ class Tournament(models.Model): reasons.append("Ce tournoi est réservé aux +55 ans") return reasons if reasons else None + def user_can_register(self, user): if not user.licence_id: return True diff --git a/tournaments/views.py b/tournaments/views.py index 4e0bfc6..25a9d6f 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -130,7 +130,7 @@ def tournament_info(request, tournament_id): registered_user = None team_registration = None is_captain = False - user_can_register = True + user_register_check = None if request.user.is_authenticated: # Assuming user's licence_id is stored in the user profile (e.g., request.user.licence_id)