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:
parent
30a0e63eb9
commit
de504a1706
@ -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):
|
||||||
|
@ -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()
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user