From e906d37b236dce7c8a45cae312acdd62179de65c Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 17 Jun 2025 07:58:51 +0200 Subject: [PATCH 01/18] fix useless related_user setting --- sync/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sync/admin.py b/sync/admin.py index 16d3c77..6134987 100644 --- a/sync/admin.py +++ b/sync/admin.py @@ -8,8 +8,8 @@ class SyncedObjectAdmin(admin.ModelAdmin): if isinstance(obj, BaseModel): obj.last_updated_by = request.user obj.last_update = timezone.now() - if obj.related_user is None: - obj.related_user = request.user + # if obj.related_user is None: + # obj.related_user = request.user super().save_model(request, obj, form, change) def delete_model(self, request, obj): From 75978ae281083460a09f2cd45f231cc723b22678 Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 18 Jun 2025 09:08:08 +0200 Subject: [PATCH 02/18] put related_user as raw_id_field --- sync/admin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sync/admin.py b/sync/admin.py index 263d9cb..48b3ee0 100644 --- a/sync/admin.py +++ b/sync/admin.py @@ -6,6 +6,7 @@ from .models import BaseModel, ModelLog, DataAccess class SyncedObjectAdmin(admin.ModelAdmin): exclude = ('data_access_ids',) + raw_id_fields = ['related_user'] def save_model(self, request, obj, form, change): if isinstance(obj, BaseModel): From b7429d980933137f263badcfae60cc8709881689 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Fri, 20 Jun 2025 15:47:07 +0200 Subject: [PATCH 03/18] fix unranked value june 2025 --- .../static/rankings/CLASSEMENT-PADEL-MESSIEURS-06-2025.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/tournaments/static/rankings/CLASSEMENT-PADEL-MESSIEURS-06-2025.csv b/tournaments/static/rankings/CLASSEMENT-PADEL-MESSIEURS-06-2025.csv index c617797..b931b65 100644 --- a/tournaments/static/rankings/CLASSEMENT-PADEL-MESSIEURS-06-2025.csv +++ b/tournaments/static/rankings/CLASSEMENT-PADEL-MESSIEURS-06-2025.csv @@ -1,4 +1,5 @@ max-players:97914 +unrank-male-value:90415 ;1;ZAPATA PIZZARO;Teodoro Victor;ESP;2098059;4145;Oui;6;ILE DE FRANCE;57 93 0505;AS PADEL AFICIONADOS;0;1;1995; ;1;HERNANDEZ QUESADA;luis;ESP;2744589;1200;Oui;1;NOUVELLE AQUITAINE;59 33 0723;BIG PADEL;0;1;1999; ;1;LIJO;Pablo ;ESP;3306546;900;Oui;1;PROVENCE ALPES COTE D'AZUR;62 13 0603;ALL IN PADEL ASSOCIATION;0;1;1991; From 2bff89b3c22f3c7483006c29912bcb187df1a336 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Fri, 20 Jun 2025 17:16:24 +0200 Subject: [PATCH 04/18] fix private tournament showdown --- tournaments/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tournaments/views.py b/tournaments/views.py index c9ff7e9..50d0fa1 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -1741,17 +1741,22 @@ def private_tournaments(request): True, 50 ) + print(tournaments) + # Filter tournaments that should be displayed display_tournament = tournaments # Categorize tournaments by status live = [] future = [] + ended = [] for t in display_tournament: if t.supposedly_in_progress(): live.append(t) elif t.starts_in_the_future(): future.append(t) + else: + ended.append(t) # Get ended tournaments clean_ended_tournaments = private_tournaments_query(Q(end_date__isnull=False), False, 50) @@ -1759,7 +1764,7 @@ def private_tournaments(request): ended_tournaments = [t for t in display_tournament if t.should_be_over()] # Combine both lists - finished = clean_ended_tournaments + ended_tournaments + finished = clean_ended_tournaments + ended_tournaments + ended # Sort the combined list by start_date in descending order finished.sort(key=lambda t: t.sorting_finished_date(), reverse=True) From 42c29cf3f6f0e4a130d5bf30e163e13302ea1b14 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Fri, 20 Jun 2025 17:19:38 +0200 Subject: [PATCH 05/18] Update views.py --- tournaments/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tournaments/views.py b/tournaments/views.py index 50d0fa1..7225d24 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -1738,7 +1738,7 @@ def private_tournaments(request): # Get all tournaments matching our criteria (similar to index but for private tournaments) tournaments = private_tournaments_query( Q(end_date__isnull=True, start_date__gte=thirty_days_ago, start_date__lte=thirty_days_future), - True, 50 + False, 50 ) print(tournaments) From 882302ab4e11a8b220a6739af5d1697452f7fe47 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Fri, 20 Jun 2025 17:24:02 +0200 Subject: [PATCH 06/18] Update views.py --- tournaments/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tournaments/views.py b/tournaments/views.py index 7225d24..cb08308 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -1768,6 +1768,7 @@ def private_tournaments(request): # Sort the combined list by start_date in descending order finished.sort(key=lambda t: t.sorting_finished_date(), reverse=True) + future.sort(key=lambda t: t.sorting_finished_date(), reverse=False) return render( request, From cfc10d0e24050ddeab345d47321c6a889da1e0c8 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Sat, 21 Jun 2025 07:04:03 +0200 Subject: [PATCH 07/18] fix dashboard and long cells date --- tournaments/models/match.py | 38 +++++++++--- tournaments/models/tournament.py | 2 +- .../admin/tournaments/dashboard.html | 60 +++++++++---------- 3 files changed, 60 insertions(+), 40 deletions(-) diff --git a/tournaments/models/match.py b/tournaments/models/match.py index 25f0a15..5d43543 100644 --- a/tournaments/models/match.py +++ b/tournaments/models/match.py @@ -330,16 +330,35 @@ class Match(TournamentSubModel): else: return 'À suivre' else: - # timezoned_datetime = timezone.localtime(self.start_date) - timezone = self.get_tournament().timezone() + # Get the tournament and timezone + tournament = self.get_tournament() + timezone = tournament.timezone() local_start = self.start_date.astimezone(timezone) - time_format ='l H:i' - if self.get_tournament().day_duration >= 7: - time_format = 'l d M à H:i' + + if tournament.day_duration >= 7: + # Use the custom month property from tournament + # First create a date object with the same date as local_start + # so we can use tournament's week_day and month properties + + # Format the hour and minute + hour = local_start.hour + minute = local_start.minute + time_str = f"{hour:02d}:{minute:02d}" + + # Create the formatted date string using tournament properties and local_start + weekday = formats.date_format(local_start, format='D') + '.' # Abbreviated weekday with period + day = local_start.day + month = tournament.month # Use the custom month property + + formatted_date = f"{weekday} {day} {month} à {time_str}" + else: + # For shorter durations, just use the weekday and time + formatted_date = formats.date_format(local_start, format='l H:i') + if self.confirmed: - return formats.date_format(local_start, format=time_format) + return formatted_date else: - return f"Estimée : {formats.date_format(local_start, format=time_format)}" + return f"Estimée : {formatted_date}" else: return 'À venir...' @@ -460,7 +479,10 @@ class Match(TournamentSubModel): bracket_name = "Match #" + f"{self.index_in_round() + 1}" ended = self.end_date is not None - live_format = "Format " + FederalMatchCategory(self.format).format_label_short + live_format = "Format " + if self.get_tournament().day_duration >= 7: + live_format = "" + live_format = live_format + FederalMatchCategory(self.format).format_label_short tournament_title = None if event_mode is True: diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 86c380d..7c78b96 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -596,7 +596,7 @@ class Tournament(BaseModel): # Format the date timezone = first_match.get_tournament().timezone() local_start = first_match.start_date.astimezone(timezone) - time_format = 'l d M' + time_format = 'l d F' formatted_schedule = f" - {formats.date_format(local_start, format=time_format)}" return MatchGroup(name, live_matches, formatted_schedule, round_id, round_index) diff --git a/tournaments/templates/admin/tournaments/dashboard.html b/tournaments/templates/admin/tournaments/dashboard.html index b6f6fb1..339224d 100644 --- a/tournaments/templates/admin/tournaments/dashboard.html +++ b/tournaments/templates/admin/tournaments/dashboard.html @@ -13,7 +13,35 @@ {% block content %}
-

🏆 Tournament Dashboard

+ +
@@ -377,36 +405,6 @@
- -