From: Yoan Le Clanche Date: Wed, 8 Sep 2021 13:16:41 +0000 (+0200) Subject: https://trackers.pilotsystems.net/prebarreau/0251 and https://trackers.pilotsystems... X-Git-Tag: 2.5.0~62 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=e76ecd2c24db7486c8ac28769822c53674989394;p=teleforma.git https://trackers.pilotsystems.net/prebarreau/0251 and https://trackers.pilotsystems.net/prebarreau/0249 --- diff --git a/teleforma/exam/forms.py b/teleforma/exam/forms.py index 278624bc..a6ea8436 100644 --- a/teleforma/exam/forms.py +++ b/teleforma/exam/forms.py @@ -18,11 +18,12 @@ class ScriptForm(ModelForm): def __init__(self, *args, **kwargs): period = kwargs.pop('period') super(ScriptForm, self).__init__(*args, **kwargs) - self.fields['score'].localize = True + self.fields['score'].localize = False nb = period.nb_script or settings.TELEFORMA_EXAM_MAX_SESSIONS self.fields['session'] = forms.ChoiceField(choices=get_n_choices(nb + 1), validators=[validate_session(nb)]) self.fields['file'].required = True + self.fields['score'].widget.attrs['onkeydown'] = "return event.key != 'Enter';" class Meta: model = Script