1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-26 05:02:23 +00:00

Fix synthesis upload

This commit is contained in:
Yohann D'ANELLO 2021-04-04 18:13:30 +02:00
parent 30a0e63eb9
commit de504a1706
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 4 additions and 3 deletions

View File

@ -222,7 +222,7 @@ class SynthesisForm(forms.ModelForm):
class Meta: class Meta:
model = Synthesis model = Synthesis
fields = ('type', 'file',) fields = ('file',)
class NoteForm(forms.ModelForm): class NoteForm(forms.ModelForm):

View File

@ -739,7 +739,7 @@ class SynthesisUploadView(LoginRequiredMixin, FormView):
self.participation = self.request.user.registration.team.participation self.participation = self.request.user.registration.team.participation
self.passage = qs.get() 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 self.handle_no_permission()
return super().dispatch(request, *args, **kwargs) 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. It is discriminating whenever the team is selected for the final tournament or not.
""" """
form_syn = form.instance form_syn = form.instance
form_syn.type = 1 if self.participation == self.passage.opponent else 2
syn_qs = Synthesis.objects.filter(participation=self.participation, syn_qs = Synthesis.objects.filter(participation=self.participation,
passage=self.passage, passage=self.passage,
type=form_syn.type).all() type=form_syn.type).all()

View File

@ -414,7 +414,7 @@ msgstr "solutions"
#: apps/participation/models.py:594 #: apps/participation/models.py:594
#, python-brace-format #, python-brace-format
msgid "Synthesis for the {type} of the {passage}" 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 #: apps/participation/models.py:597
msgid "synthesis" msgid "synthesis"