diff --git a/tournaments/services/tournament_registration.py b/tournaments/services/tournament_registration.py index ee7b9b1..900615a 100644 --- a/tournaments/services/tournament_registration.py +++ b/tournaments/services/tournament_registration.py @@ -248,8 +248,8 @@ class RegistrationCartManager: if tournament_federal_category == FederalCategory.MIXED and len(players) == 1: other_player_is_woman = players[0].get('is_woman', False) - if other_player_is_woman == is_woman: - is_woman = not is_woman + if players[0].get('found_in_french_federation', False): + is_woman = not other_player_is_woman player_data.update({ 'rank': fed_data['rank'], @@ -260,8 +260,9 @@ class RegistrationCartManager: if tournament_federal_category == FederalCategory.MIXED and len(players) == 1: is_woman = fed_data.get('is_woman', False) other_player_is_woman = players[0].get('is_woman', False) - if other_player_is_woman == is_woman: - return False, f"En mixte l'équipe doit obligatoirement contenir une joueuse et un joueur. La licence {licence_id} correspond à {'une' if is_woman else 'un'} {'femme' if is_woman else 'homme'}." + if players[0].get('found_in_french_federation', False): + if other_player_is_woman == is_woman: + return False, f"En mixte l'équipe doit obligatoirement contenir une joueuse et un joueur. La licence {licence_id} correspond à {'une' if is_woman else 'un'} {'femme' if is_woman else 'homme'}." player_register_check = tournament.player_register_check(licence_id) if player_register_check: diff --git a/tournaments/templates/register_tournament.html b/tournaments/templates/register_tournament.html index b25cb0e..c74c908 100644 --- a/tournaments/templates/register_tournament.html +++ b/tournaments/templates/register_tournament.html @@ -150,11 +150,23 @@ {% endif %} {% if add_player_form.first_tournament or add_player_form.user_without_licence or tournament.license_is_required is False %} {% if not add_player_form.user_without_licence and tournament.license_is_required is True %} + {% if current_players|length > 0 %} +