|
|
|
|
@ -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) |
|
|
|
|
|