From 3e0b51c4c94dd1d7214cd72ff44adf7dc2e97a33 Mon Sep 17 00:00:00 2001 From: Raz Date: Tue, 15 Apr 2025 08:01:04 +0200 Subject: [PATCH] fix refund stuff --- tournaments/models/team_registration.py | 5 ----- tournaments/services/payment_service.py | 2 +- tournaments/templates/tournaments/tournament_info.html | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tournaments/models/team_registration.py b/tournaments/models/team_registration.py index c9d6d28..bf77748 100644 --- a/tournaments/models/team_registration.py +++ b/tournaments/models/team_registration.py @@ -333,7 +333,6 @@ class TeamRegistration(SideStoreModel): def confirm_registration(self, payment_intent_id=None): """Confirm the team's registration after being moved from waiting list""" - now = timezone.now() # Update all players in the team for player in self.players_sorted_by_rank: player.time_to_confirm = None @@ -343,10 +342,6 @@ class TeamRegistration(SideStoreModel): player.registration_status = RegistrationStatus.CONFIRMED player.save() - # Save confirmation date - self.confirmation_date = now - self.save() - # Add to TeamRegistration class in team_registration.py def get_payment_status(self): """ diff --git a/tournaments/services/payment_service.py b/tournaments/services/payment_service.py index 78729d9..dd77dd7 100644 --- a/tournaments/services/payment_service.py +++ b/tournaments/services/payment_service.py @@ -328,7 +328,7 @@ class PaymentService: TournamentEmailService.send_refund_confirmation(tournament, team_registration, refund) # Return success with refund object - return True, "Votre inscription a été remboursée automatiquement.", refund + return True, "L'inscription a été remboursée automatiquement.", refund except stripe.error.StripeError as e: return False, f"Erreur de remboursement Stripe: {str(e)}", None diff --git a/tournaments/templates/tournaments/tournament_info.html b/tournaments/templates/tournaments/tournament_info.html index 9e4f9bd..4678658 100644 --- a/tournaments/templates/tournaments/tournament_info.html +++ b/tournaments/templates/tournaments/tournament_info.html @@ -116,7 +116,7 @@
{% if tournament.is_refund_possible and team.is_paid %}

- 💰 Si vous vous désinscrivez, votre inscription sera remboursée automatiquement sur votre carte bancaire. + Si vous vous désinscrivez, votre inscription sera remboursée automatiquement sur votre carte bancaire. {% if tournament.refund_date_limit %}
Remboursement possible jusqu'au {{ tournament.refund_date_limit|date:"d/m/Y à H:i" }} {% endif %}