diff --git a/apps/participation/forms.py b/apps/participation/forms.py index 52059b1..19c7023 100644 --- a/apps/participation/forms.py +++ b/apps/participation/forms.py @@ -222,7 +222,7 @@ class SynthesisForm(forms.ModelForm): class Meta: model = Synthesis - fields = ('type', 'file',) + fields = ('file',) class NoteForm(forms.ModelForm): diff --git a/apps/participation/views.py b/apps/participation/views.py index e0ce1c3..9a51bfa 100644 --- a/apps/participation/views.py +++ b/apps/participation/views.py @@ -739,7 +739,7 @@ class SynthesisUploadView(LoginRequiredMixin, FormView): self.participation = self.request.user.registration.team.participation self.passage = qs.get() - if self.participation not in [self.passage.defender, self.passage.opponent, self.passage.reporter]: + if self.participation not in [self.passage.opponent, self.passage.reporter]: return self.handle_no_permission() return super().dispatch(request, *args, **kwargs) @@ -751,6 +751,7 @@ class SynthesisUploadView(LoginRequiredMixin, FormView): It is discriminating whenever the team is selected for the final tournament or not. """ form_syn = form.instance + form_syn.type = 1 if self.participation == self.passage.opponent else 2 syn_qs = Synthesis.objects.filter(participation=self.participation, passage=self.passage, type=form_syn.type).all() diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index bc79c94..3febf23 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -414,7 +414,7 @@ msgstr "solutions" #: apps/participation/models.py:594 #, python-brace-format msgid "Synthesis for the {type} of the {passage}" -msgstr "Synthèse pour {type} du {passage}" +msgstr "Synthèse de {type} du {passage}" #: apps/participation/models.py:597 msgid "synthesis"