1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-23 21:01:22 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Emmy D'Anello
1138885fb4
Fix TFJM sympa lists every day instead of every two minutes
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-05-19 21:18:58 +02:00
Emmy D'Anello
a43dc9c12a
Fix total score in tfjm.org export for 5-teams pools
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-05-19 21:09:34 +02:00
Emmy D'Anello
70050827d8
Better bold lines in tfjm.org export
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-05-19 21:02:44 +02:00
Emmy D'Anello
f687deed14
Fix bold lines in tfjm.org export
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
2024-05-19 20:55:47 +02:00
2 changed files with 20 additions and 19 deletions

View File

@ -17,8 +17,8 @@ class Command(BaseCommand):
self.w("") self.w("")
self.w("") self.w("")
def w(self, msg): def w(self, msg, prefix="", suffix=""):
self.stdout.write(msg) self.stdout.write(f"{prefix}{msg}{suffix}")
def handle_tournament(self, tournament): def handle_tournament(self, tournament):
name = tournament.name name = tournament.name
@ -52,28 +52,29 @@ class Command(BaseCommand):
self.w("<table>") self.w("<table>")
self.w("<thead>") self.w("<thead>")
self.w("<tr>") self.w("<tr>")
self.w("\t<th>Équipe</th>") self.w(" <th>Équipe</th>")
self.w("\t<th>Score Tour 1</th>") self.w(" <th>Score Tour 1</th>")
self.w("\t<th>Score Tour 2</th>") self.w(" <th>Score Tour 2</th>")
self.w("\t<th>Total</th>") self.w(" <th>Total</th>")
self.w("\t<th class=\"has-text-align-center\">Prix</th>") self.w(" <th class=\"has-text-align-center\">Prix</th>")
self.w("</tr>") self.w("</tr>")
self.w("</thead>") self.w("</thead>")
self.w("<tbody>") self.w("<tbody>")
for i, (participation, note) in enumerate(notes): for i, (participation, note) in enumerate(notes):
self.w("<tr>") self.w("<tr>")
if i < (2 if len(notes) >= 7 else 1): bold = (not tournament.final and participation.final) or (tournament.final and i < 2)
self.w(f"\t<th>{participation.team.name} ({participation.team.trigram})</td>") if bold:
prefix, suffix = " <td><strong>", "</strong></td>"
else: else:
self.w(f"\t<td>{participation.team.name} ({participation.team.trigram})</td>") prefix, suffix = " <td>", "</td>"
for pool in tournament.pools.filter(participations=participation).all(): self.w(f"{participation.team.name} ({participation.team.trigram})", prefix, suffix)
pool_note = pool.average(participation) for tournament_round in [1, 2]:
self.w(f"\t<td>{pool_note:.01f}</td>") pool_note = sum(pool.average(participation)
self.w(f"\t<td>{note:.01f}</td>") for pool in tournament.pools.filter(participations=participation,
if tournament.final: round=tournament_round).all())
self.w(f"\t<td>{participation.mention_final}</td>") self.w(f"{pool_note:.01f}", prefix, suffix)
else: self.w(f"{note:.01f}", prefix, suffix)
self.w(f"\t<td>{participation.mention}</td>") self.w(participation.mention_final if tournament.final else participation.mention, prefix, suffix)
self.w("</tr>") self.w("</tr>")
self.w("</tbody>") self.w("</tbody>")
self.w("</table>") self.w("</table>")

View File

@ -8,7 +8,7 @@
*/2 * * * * cd /code && python manage.py update_index &> /dev/null */2 * * * * cd /code && python manage.py update_index &> /dev/null
# Recreate sympa lists # Recreate sympa lists
*/2 * * * * cd /code && python manage.py fix_sympa_lists &> /dev/null 7 3 * * * cd /code && python manage.py fix_sympa_lists &> /dev/null
# Check payments from Hello Asso # Check payments from Hello Asso
*/6 * * * * cd /code && python manage.py check_hello_asso &> /dev/null */6 * * * * cd /code && python manage.py check_hello_asso &> /dev/null