diff --git a/draw/models.py b/draw/models.py index 5c021d2..e5b0edf 100644 --- a/draw/models.py +++ b/draw/models.py @@ -416,7 +416,7 @@ class Pool(models.Model): passage_pool = pool2 passage_position = 1 + i // 2 - defender = tds[line[0]].participation + reporter = tds[line[0]].participation opponent = tds[line[1]].participation reviewer = tds[line[2]].participation observer = tds[line[3]].participation if self.size >= 4 and settings.TFJM_APP == "ETEAM" else None @@ -426,11 +426,11 @@ class Pool(models.Model): pool=passage_pool, position=passage_position, solution_number=tds[line[0]].accepted, - defender=defender, + reporter=reporter, opponent=opponent, reviewer=reviewer, observer=observer, - defender_penalties=tds[line[0]].penalty_int, + reporter_penalties=tds[line[0]].penalty_int, ) # Update Google Sheets @@ -549,7 +549,7 @@ class TeamDraw(models.Model): @property def penalty(self): """ - The penalty multiplier on the defender oral, in percentage, which is a malus of 25% for each penalty. + The penalty multiplier on the reporter oral, in percentage, which is a malus of 25% for each penalty. """ return 25 * self.penalty_int diff --git a/draw/static/tfjm/js/draw.js b/draw/static/tfjm/js/draw.js index bbb1736..5cfab41 100644 --- a/draw/static/tfjm/js/draw.js +++ b/draw/static/tfjm/js/draw.js @@ -521,9 +521,9 @@ document.addEventListener('DOMContentLoaded', () => { teamTd.innerText = team teamTr.append(teamTd) - let defenderTd = document.createElement('td') - defenderTd.classList.add('text-center') - defenderTd.innerText = 'Déf' + let reporterTd = document.createElement('td') + reporterTd.classList.add('text-center') + reporterTd.innerText = 'Déf' let opponentTd = document.createElement('td') opponentTd.classList.add('text-center') @@ -537,29 +537,29 @@ document.addEventListener('DOMContentLoaded', () => { if (poule.teams.length === 3) { switch (i) { case 0: - teamTr.append(defenderTd, reviewerTd, opponentTd) + teamTr.append(reporterTd, reviewerTd, opponentTd) break case 1: - teamTr.append(opponentTd, defenderTd, reviewerTd) + teamTr.append(opponentTd, reporterTd, reviewerTd) break case 2: - teamTr.append(reviewerTd, opponentTd, defenderTd) + teamTr.append(reviewerTd, opponentTd, reporterTd) break } } else if (poule.teams.length === 4) { let emptyTd = document.createElement('td') switch (i) { case 0: - teamTr.append(defenderTd, emptyTd, reviewerTd, opponentTd) + teamTr.append(reporterTd, emptyTd, reviewerTd, opponentTd) break case 1: - teamTr.append(opponentTd, defenderTd, emptyTd, reviewerTd) + teamTr.append(opponentTd, reporterTd, emptyTd, reviewerTd) break case 2: - teamTr.append(reviewerTd, opponentTd, defenderTd, emptyTd) + teamTr.append(reviewerTd, opponentTd, reporterTd, emptyTd) break case 3: - teamTr.append(emptyTd, reviewerTd, opponentTd, defenderTd) + teamTr.append(emptyTd, reviewerTd, opponentTd, reporterTd) break } } else if (poule.teams.length === 5) { @@ -567,19 +567,19 @@ document.addEventListener('DOMContentLoaded', () => { let emptyTd2 = document.createElement('td') switch (i) { case 0: - teamTr.append(defenderTd, emptyTd, opponentTd, reviewerTd, emptyTd2) + teamTr.append(reporterTd, emptyTd, opponentTd, reviewerTd, emptyTd2) break case 1: - teamTr.append(emptyTd, defenderTd, reviewerTd, emptyTd2, opponentTd) + teamTr.append(emptyTd, reporterTd, reviewerTd, emptyTd2, opponentTd) break case 2: - teamTr.append(opponentTd, emptyTd, defenderTd, emptyTd2, reviewerTd) + teamTr.append(opponentTd, emptyTd, reporterTd, emptyTd2, reviewerTd) break case 3: - teamTr.append(reviewerTd, opponentTd, emptyTd, defenderTd, emptyTd2) + teamTr.append(reviewerTd, opponentTd, emptyTd, reporterTd, emptyTd2) break case 4: - teamTr.append(emptyTd, reviewerTd, emptyTd2, opponentTd, defenderTd) + teamTr.append(emptyTd, reviewerTd, emptyTd2, opponentTd, reporterTd) break } } @@ -662,7 +662,7 @@ document.addEventListener('DOMContentLoaded', () => { let penaltyDiv = document.getElementById(`recap-${tid}-round-${round}-team-${team}-penalty`) if (rejected.length > problems_count - RECOMMENDED_SOLUTIONS_COUNT) { - // If more than P - 5 problems were rejected, add a penalty of 25% of the coefficient of the oral defender + // If more than P - 5 problems were rejected, add a penalty of 25% of the coefficient of the oral reporter // This is P - 6 for the ETEAM if (penaltyDiv === null) { penaltyDiv = document.createElement('div') diff --git a/draw/templates/draw/tournament_content.html b/draw/templates/draw/tournament_content.html index d0f22d8..907fa6a 100644 --- a/draw/templates/draw/tournament_content.html +++ b/draw/templates/draw/tournament_content.html @@ -307,71 +307,71 @@
The solutions draw is ended. You can check the result on this page.
For the first round, you will defend " +"href='{draw_url}'>this page.
For the first round, you will present " "your solution of the problem {problem}.
" msgstr "" "Le tirage au sort des solutions est terminé. Vous pouvez consulter les " @@ -1499,7 +1560,7 @@ msgstr "Premier tour" #: participation/models.py:986 #, python-brace-format msgid "" -"
For the second round, you will defend your "
+" For the second round, you will present your "
"solution of the problem {problem}. Pour le second tour, vous défendrez votre "
@@ -1513,7 +1574,7 @@ msgstr "Second tour"
#: participation/models.py:1050
#, python-brace-format
msgid ""
-" For the third round, you will defend your "
+" For the third round, you will present your "
"solution of the problem {problem}. Pour le troisième tour, vous défendrez votre "
@@ -1638,7 +1699,7 @@ msgid "position"
msgstr "position"
#: participation/models.py:1687
-msgid "defended solution"
+msgid "reported solution"
msgstr "solution défendue"
#: participation/models.py:1725
@@ -1647,7 +1708,7 @@ msgstr "pénalités"
#: participation/models.py:1727
msgid ""
-"Number of penalties for the defender. The defender will loose a 0.5 "
+"Number of penalties for the reporter. The reporter will loose a 0.5 "
"coefficient per penalty."
msgstr ""
"Nombre de pénalités pour l'équipe défenseuse. Elle perd un coefficient 0.5 "
@@ -1661,8 +1722,8 @@ msgstr "L'équipe {trigram} n'est pas inscrite dans la poule."
#: participation/models.py:1867
#, python-brace-format
-msgid "Passage of {defender} for problem {problem}"
-msgstr "Passage de {defender} pour le problème {problem}"
+msgid "Passage of {reporter} for problem {problem}"
+msgstr "Passage de {reporter} pour le problème {problem}"
#: participation/models.py:1871 participation/models.py:1880
#: participation/models.py:1969 participation/models.py:2012
@@ -1716,10 +1777,10 @@ msgstr "solutions"
#: participation/models.py:1987
#, python-brace-format
-msgid "Written review of {team} as {type} for problem {problem} of {defender}"
+msgid "Written review of {team} as {type} for problem {problem} of {reporter}"
msgstr ""
"Note de synthèse de l'équipe {team} en tant que {type} pour le problème "
-"{problem} de {defender}"
+"{problem} de {reporter}"
#: participation/models.py:1995
msgid "written review"
@@ -1734,11 +1795,11 @@ msgid "jury"
msgstr "jury"
#: participation/models.py:2017
-msgid "defender writing note"
+msgid "reporter writing note"
msgstr "note d'écrit défenseur⋅se"
#: participation/models.py:2023
-msgid "defender oral note"
+msgid "reporter oral note"
msgstr "note d'oral défenseur⋅se"
#: participation/models.py:2029
@@ -1933,7 +1994,7 @@ msgid "Position:"
msgstr "Position :"
#: participation/templates/participation/passage_detail.html:28
-msgid "Defender:"
+msgid "Reporter:"
msgstr "Défenseur⋅se :"
#: participation/templates/participation/passage_detail.html:31
@@ -1949,11 +2010,11 @@ msgid "Observer:"
msgstr "Observateur⋅rice :"
#: participation/templates/participation/passage_detail.html:42
-msgid "Defended solution:"
+msgid "Reported solution:"
msgstr "Solution défendue"
#: participation/templates/participation/passage_detail.html:45
-msgid "Defender penalties count:"
+msgid "Reporter penalties count:"
msgstr "Nombre de pénalités :"
#: participation/templates/participation/passage_detail.html:48
@@ -1981,11 +2042,11 @@ msgid "Notes detail"
msgstr "Détails des notes"
#: participation/templates/participation/passage_detail.html:82
-msgid "Average points for the defender writing"
+msgid "Average points for the reporter writing"
msgstr "Moyenne de l'écrit de l'équipe défenseuse"
#: participation/templates/participation/passage_detail.html:90
-msgid "Average points for the defender oral"
+msgid "Average points for the reporter oral"
msgstr "Moyenne de l'oral de l'équipe défenseuse"
#: participation/templates/participation/passage_detail.html:98
@@ -2013,7 +2074,7 @@ msgid "Average points for the observer oral"
msgstr "Moyenne de l'oral de l'équipe observatrice"
#: participation/templates/participation/passage_detail.html:140
-msgid "Defender points"
+msgid "Reporter points"
msgstr "Points de l'équipe défenseuse"
#: participation/templates/participation/passage_detail.html:148
@@ -2058,7 +2119,7 @@ msgid "Edit jury"
msgstr "Modifier le jury"
#: participation/templates/participation/pool_detail.html:49
-msgid "Defended solutions:"
+msgid "Reported solutions:"
msgstr "Solutions défendues :"
#: participation/templates/participation/pool_detail.html:55
@@ -2755,7 +2816,7 @@ msgid "Notes were successfully uploaded."
msgstr "Les notes ont bien été envoyées."
#: participation/views.py:1507
-msgid "Defender"
+msgid "Reporter"
msgstr "Défenseur⋅se"
#: participation/views.py:1513
diff --git a/participation/admin.py b/participation/admin.py
index a94b57e..86ad076 100644
--- a/participation/admin.py
+++ b/participation/admin.py
@@ -51,7 +51,7 @@ class PassageInline(admin.TabularInline):
model = Passage
extra = 0
ordering = ('position',)
- autocomplete_fields = ('defender', 'opponent', 'reviewer', 'observer',)
+ autocomplete_fields = ('reporter', 'opponent', 'reviewer', 'observer',)
show_change_link = True
@@ -113,17 +113,17 @@ class PoolAdmin(admin.ModelAdmin):
@admin.register(Passage)
class PassageAdmin(admin.ModelAdmin):
- list_display = ('__str__', 'defender_trigram', 'solution_number', 'opponent_trigram', 'reviewer_trigram',
+ list_display = ('__str__', 'reporter_trigram', 'solution_number', 'opponent_trigram', 'reviewer_trigram',
'observer_trigram', 'pool_abbr', 'position', 'tournament')
list_filter = ('pool__tournament', 'pool__round', 'pool__letter', 'solution_number',)
search_fields = ('pool__participations__team__name', 'pool__participations__team__trigram',)
ordering = ('pool__tournament', 'pool__round', 'pool__letter', 'position',)
- autocomplete_fields = ('pool', 'defender', 'opponent', 'reviewer', 'observer',)
+ autocomplete_fields = ('pool', 'reporter', 'opponent', 'reviewer', 'observer',)
inlines = (NoteInline,)
- @admin.display(description=_("defender"), ordering='defender__team__trigram')
- def defender_trigram(self, record: Passage):
- return record.defender.team.trigram
+ @admin.display(description=_("reporter"), ordering='reporter__team__trigram')
+ def reporter_trigram(self, record: Passage):
+ return record.reporter.team.trigram
@admin.display(description=_("opponent"), ordering='opponent__team__trigram')
def opponent_trigram(self, record: Passage):
@@ -148,13 +148,13 @@ class PassageAdmin(admin.ModelAdmin):
@admin.register(Note)
class NoteAdmin(admin.ModelAdmin):
- list_display = ('passage', 'pool', 'jury', 'defender_writing', 'defender_oral',
+ list_display = ('passage', 'pool', 'jury', 'reporter_writing', 'reporter_oral',
'opponent_writing', 'opponent_oral', 'reviewer_writing', 'reviewer_oral',
'observer_writing', 'observer_oral',)
list_filter = ('passage__pool__letter', 'passage__solution_number', 'jury',
- 'defender_writing', 'defender_oral', 'opponent_writing', 'opponent_oral',
+ 'reporter_writing', 'reporter_oral', 'opponent_writing', 'opponent_oral',
'reviewer_writing', 'reviewer_oral', 'observer_writing', 'observer_oral')
- search_fields = ('jury__user__last_name', 'jury__user__first_name', 'passage__defender__team__trigram',)
+ search_fields = ('jury__user__last_name', 'jury__user__first_name', 'passage__reporter__team__trigram',)
autocomplete_fields = ('jury', 'passage',)
@admin.display(description=_("pool"))
@@ -180,14 +180,14 @@ class SolutionAdmin(admin.ModelAdmin):
@admin.register(WrittenReview)
class WrittenReviewAdmin(admin.ModelAdmin):
- list_display = ('participation', 'type', 'defender', 'passage',)
+ list_display = ('participation', 'type', 'reporter', 'passage',)
list_filter = ('participation__tournament', 'type', 'passage__solution_number',)
search_fields = ('participation__team__name', 'participation__team__trigram',)
autocomplete_fields = ('participation', 'passage',)
- @admin.display(description=_("defender"))
- def defender(self, record: WrittenReview):
- return record.passage.defender
+ @admin.display(description=_("reporter"))
+ def reporter(self, record: WrittenReview):
+ return record.passage.reporter
@admin.display(description=_("problem"))
def problem(self, record: WrittenReview):
diff --git a/participation/api/views.py b/participation/api/views.py
index 097e739..c4906e5 100644
--- a/participation/api/views.py
+++ b/participation/api/views.py
@@ -12,7 +12,7 @@ class NoteViewSet(ModelViewSet):
queryset = Note.objects.all()
serializer_class = NoteSerializer
filter_backends = [DjangoFilterBackend]
- filterset_fields = ['jury', 'passage', 'defender_writing', 'defender_oral', 'opponent_writing',
+ filterset_fields = ['jury', 'passage', 'reporter_writing', 'reporter_oral', 'opponent_writing',
'opponent_oral', 'reviewer_writing', 'reviewer_oral', 'observer_writing', 'observer_oral', ]
@@ -27,7 +27,7 @@ class PassageViewSet(ModelViewSet):
queryset = Passage.objects.all()
serializer_class = PassageSerializer
filter_backends = [DjangoFilterBackend]
- filterset_fields = ['pool', 'solution_number', 'defender', 'opponent', 'reviewer', 'observer', 'pool_tournament', ]
+ filterset_fields = ['pool', 'solution_number', 'reporter', 'opponent', 'reviewer', 'observer', 'pool_tournament', ]
class PoolViewSet(ModelViewSet):
diff --git a/participation/forms.py b/participation/forms.py
index 9cdd64d..04795d4 100644
--- a/participation/forms.py
+++ b/participation/forms.py
@@ -345,18 +345,18 @@ class UploadNotesForm(forms.Form):
class PassageForm(forms.ModelForm):
def clean(self):
cleaned_data = super().clean()
- if "defender" in cleaned_data and "opponent" in cleaned_data and "reviewer" in cleaned_data \
- and len({cleaned_data["defender"], cleaned_data["opponent"], cleaned_data["reviewer"]}) < 3:
- self.add_error(None, _("The defender, the opponent and the reviewer must be different."))
- if "defender" in self.cleaned_data and "solution_number" in self.cleaned_data \
- and not Solution.objects.filter(participation=cleaned_data["defender"],
+ if "reporter" in cleaned_data and "opponent" in cleaned_data and "reviewer" in cleaned_data \
+ and len({cleaned_data["reporter"], cleaned_data["opponent"], cleaned_data["reviewer"]}) < 3:
+ self.add_error(None, _("The reporter, the opponent and the reviewer must be different."))
+ if "reporter" in self.cleaned_data and "solution_number" in self.cleaned_data \
+ and not Solution.objects.filter(participation=cleaned_data["reporter"],
problem=cleaned_data["solution_number"]).exists():
- self.add_error("solution_number", _("This defender did not work on this problem."))
+ self.add_error("solution_number", _("This reporter did not work on this problem."))
return cleaned_data
class Meta:
model = Passage
- fields = ('position', 'solution_number', 'defender', 'opponent', 'reviewer', 'opponent', 'defender_penalties',)
+ fields = ('position', 'solution_number', 'reporter', 'opponent', 'reviewer', 'opponent', 'reporter_penalties',)
class WrittenReviewForm(forms.ModelForm):
@@ -386,5 +386,5 @@ class WrittenReviewForm(forms.ModelForm):
class NoteForm(forms.ModelForm):
class Meta:
model = Note
- fields = ('defender_writing', 'defender_oral', 'opponent_writing',
+ fields = ('reporter_writing', 'reporter_oral', 'opponent_writing',
'opponent_oral', 'reviewer_writing', 'reviewer_oral', 'observer_writing', 'observer_oral', )
diff --git a/participation/management/commands/generate_seconds_sheet.py b/participation/management/commands/generate_seconds_sheet.py
index 45928d2..74ab1d0 100644
--- a/participation/management/commands/generate_seconds_sheet.py
+++ b/participation/management/commands/generate_seconds_sheet.py
@@ -51,23 +51,23 @@ class Command(BaseCommand):
team3, score3 = sorted_notes[2]
pool1 = tournament.pools.filter(round=1, participations=team2).first()
- defender_passage_1 = Passage.objects.get(pool__tournament=tournament, pool__round=1, defender=team2)
+ reporter_passage_1 = Passage.objects.get(pool__tournament=tournament, pool__round=1, reporter=team2)
opponent_passage_1 = Passage.objects.get(pool__tournament=tournament, pool__round=1, opponent=team2)
reviewer_passage_1 = Passage.objects.get(pool__tournament=tournament, pool__round=1, reviewer=team2)
pool2 = tournament.pools.filter(round=2, participations=team2).first()
- defender_passage_2 = Passage.objects.get(pool__tournament=tournament, pool__round=2, defender=team2)
+ reporter_passage_2 = Passage.objects.get(pool__tournament=tournament, pool__round=2, reporter=team2)
opponent_passage_2 = Passage.objects.get(pool__tournament=tournament, pool__round=2, opponent=team2)
reviewer_passage_2 = Passage.objects.get(pool__tournament=tournament, pool__round=2, reviewer=team2)
line.append(team2.team.trigram)
line.append(str(pool1.jury_president or ""))
- line.append(f"Pb. {defender_passage_1.solution_number}")
- line.extend([defender_passage_1.average_defender_writing, defender_passage_1.average_defender_oral,
+ line.append(f"Pb. {reporter_passage_1.solution_number}")
+ line.extend([reporter_passage_1.average_reporter_writing, reporter_passage_1.average_reporter_oral,
opponent_passage_1.average_opponent_writing, opponent_passage_1.average_opponent_oral,
reviewer_passage_1.average_reviewer_writing, reviewer_passage_1.average_reviewer_oral])
line.append(str(pool2.jury_president or ""))
- line.append(f"Pb. {defender_passage_2.solution_number}")
- line.extend([defender_passage_2.average_defender_writing, defender_passage_2.average_defender_oral,
+ line.append(f"Pb. {reporter_passage_2.solution_number}")
+ line.extend([reporter_passage_2.average_reporter_writing, reporter_passage_2.average_reporter_oral,
opponent_passage_2.average_opponent_writing, opponent_passage_2.average_opponent_oral,
reviewer_passage_2.average_reviewer_writing, reviewer_passage_2.average_reviewer_oral])
line.extend([score2, f"{score1:.1f} ({team1.team.trigram})",
diff --git a/participation/migrations/0021_rename_defender_oral_note_reporter_oral_and_more.py b/participation/migrations/0021_rename_defender_oral_note_reporter_oral_and_more.py
new file mode 100644
index 0000000..328653d
--- /dev/null
+++ b/participation/migrations/0021_rename_defender_oral_note_reporter_oral_and_more.py
@@ -0,0 +1,133 @@
+# Generated by Django 5.0.6 on 2024-07-06 20:00
+import django
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("participation", "0020_rename_synthesis_writtenreview_and_more"),
+ ]
+
+ operations = [
+ migrations.RenameField(
+ model_name="note",
+ old_name="defender_oral",
+ new_name="reporter_oral",
+ ),
+ migrations.RenameField(
+ model_name="note",
+ old_name="defender_writing",
+ new_name="reporter_writing",
+ ),
+ migrations.RenameField(
+ model_name="passage",
+ old_name="defender",
+ new_name="reporter",
+ ),
+ migrations.RenameField(
+ model_name="passage",
+ old_name="defender_penalties",
+ new_name="reporter_penalties",
+ ),
+ migrations.AlterField(
+ model_name="passage",
+ name="solution_number",
+ field=models.PositiveSmallIntegerField(
+ choices=[
+ (1, "Problem #1"),
+ (2, "Problem #2"),
+ (3, "Problem #3"),
+ (4, "Problem #4"),
+ (5, "Problem #5"),
+ (6, "Problem #6"),
+ (7, "Problem #7"),
+ (8, "Problem #8"),
+ (9, "Problem #9"),
+ (10, "Problem #10"),
+ ],
+ verbose_name="reported solution",
+ ),
+ ),
+ migrations.AlterField(
+ model_name="note",
+ name="reporter_oral",
+ field=models.PositiveSmallIntegerField(
+ choices=[
+ (0, 0),
+ (1, 1),
+ (2, 2),
+ (3, 3),
+ (4, 4),
+ (5, 5),
+ (6, 6),
+ (7, 7),
+ (8, 8),
+ (9, 9),
+ (10, 10),
+ (11, 11),
+ (12, 12),
+ (13, 13),
+ (14, 14),
+ (15, 15),
+ (16, 16),
+ (17, 17),
+ (18, 18),
+ (19, 19),
+ (20, 20),
+ ],
+ default=0,
+ verbose_name="reporter oral note",
+ ),
+ ),
+ migrations.AlterField(
+ model_name="note",
+ name="reporter_writing",
+ field=models.PositiveSmallIntegerField(
+ choices=[
+ (0, 0),
+ (1, 1),
+ (2, 2),
+ (3, 3),
+ (4, 4),
+ (5, 5),
+ (6, 6),
+ (7, 7),
+ (8, 8),
+ (9, 9),
+ (10, 10),
+ (11, 11),
+ (12, 12),
+ (13, 13),
+ (14, 14),
+ (15, 15),
+ (16, 16),
+ (17, 17),
+ (18, 18),
+ (19, 19),
+ (20, 20),
+ ],
+ default=0,
+ verbose_name="reporter writing note",
+ ),
+ ),
+ migrations.AlterField(
+ model_name="passage",
+ name="reporter",
+ field=models.ForeignKey(
+ on_delete=django.db.models.deletion.PROTECT,
+ related_name="+",
+ to="participation.participation",
+ verbose_name="reporter",
+ ),
+ ),
+ migrations.AlterField(
+ model_name="passage",
+ name="reporter_penalties",
+ field=models.PositiveSmallIntegerField(
+ default=0,
+ help_text="Number of penalties for the reporter. The reporter will loose a 0.5 coefficient per penalty.",
+ verbose_name="penalties",
+ ),
+ ),
+ ]
diff --git a/participation/models.py b/participation/models.py
index 2452e30..48234cb 100644
--- a/participation/models.py
+++ b/participation/models.py
@@ -490,7 +490,7 @@ class Tournament(models.Model):
line = [f"{participation.team.name} ({participation.team.trigram})"]
lines.append(line)
- passage1 = Passage.objects.get(pool__tournament=self, pool__round=1, defender=participation)
+ passage1 = Passage.objects.get(pool__tournament=self, pool__round=1, reporter=participation)
pool1 = passage1.pool
if pool1.participations.count() != 5:
position1 = passage1.position
@@ -502,8 +502,8 @@ class Tournament(models.Model):
line.append(f"=SIERREUR('{_('Pool')} {pool1.short_name}'!$D{pool1.juries.count() + 10 + position1}; 0)")
line.append(tweak1.diff if tweak1 else 0)
- if Passage.objects.filter(pool__tournament=self, pool__round=2, defender=participation).exists():
- passage2 = Passage.objects.get(pool__tournament=self, pool__round=2, defender=participation)
+ if Passage.objects.filter(pool__tournament=self, pool__round=2, reporter=participation).exists():
+ passage2 = Passage.objects.get(pool__tournament=self, pool__round=2, reporter=participation)
pool2 = passage2.pool
if pool2.participations.count() != 5:
position2 = passage2.position
@@ -519,8 +519,8 @@ class Tournament(models.Model):
if settings.NB_ROUNDS >= 3:
line.append(f"=$B{i + 2} + $C{i + 2} + $D{i + 2} + E{i + 2}")
- if Passage.objects.filter(pool__tournament=self, pool__round=3, defender=participation).exists():
- passage3 = Passage.objects.get(pool__tournament=self, pool__round=3, defender=participation)
+ if Passage.objects.filter(pool__tournament=self, pool__round=3, reporter=participation).exists():
+ passage3 = Passage.objects.get(pool__tournament=self, pool__round=3, reporter=participation)
pool3 = passage3.pool
if pool3.participations.count() != 5:
position3 = passage3.position
@@ -912,36 +912,36 @@ class Participation(models.Model):
'content': content,
})
elif timezone.now() <= tournament.reviews_first_phase_limit + timedelta(hours=2):
- defender_passage = Passage.objects.get(pool__tournament=self.tournament, pool__round=1, defender=self)
+ reporter_passage = Passage.objects.get(pool__tournament=self.tournament, pool__round=1, reporter=self)
opponent_passage = Passage.objects.get(pool__tournament=self.tournament, pool__round=1, opponent=self)
reviewer_passage = Passage.objects.get(pool__tournament=self.tournament, pool__round=1, reviewer=self)
observer_passage = Passage.objects.filter(pool__tournament=self.tournament, pool__round=1, observer=self)
observer_passage = observer_passage.get() if observer_passage.exists() else None
- defender_text = _(" The solutions draw is ended. You can check the result on "
+ reporter_text = _(" The solutions draw is ended. You can check the result on "
"this page. For the first round, you will defend "
+ " For the first round, you will present "
"your solution of the problem {problem}. You will oppose the solution of the team {opponent} on the "
"problem {problem}. "
"You can upload your written review on this page. You will report the solution of the team {reviewer} on the "
"problem {problem}. "
"You can upload your written review on this page. You will observe the solution of the team {observer} on the "
"problem {problem}. "
"You can upload your written review on this page. {_('Templates:')} {reviews_templates} For the second round, you will defend "
+ reporter_text = _(" For the second round, you will present "
"your solution of the problem {problem}. You will oppose the solution of the team {opponent} on the "
"problem {problem}. "
"You can upload your written review on this page. You will report the solution of the team {reviewer} on the "
"problem {problem}. "
"You can upload your written review on this page. You will observe the solution of the team {observer} on the "
"problem {problem}. "
"You can upload your written review on this page. {_('Templates:')} {reviews_templates} For the third round, you will defend "
+ reporter_text = _(" For the third round, you will present "
"your solution of the problem {problem}. You will oppose the solution of the team {opponent} on the "
"problem {problem}. "
"You can upload your written review on this page. You will report the solution of the team {reviewer} on the "
"problem {problem}. "
"You can upload your written review on this page. You will observe the solution of the team {observer} on the "
"problem {problem}. "
"You can upload your written review on this page. {_('Templates:')} {reviews_templates}