From 25226a1f792f7e9c4ebdfcd20a57adff6e47d39b Mon Sep 17 00:00:00 2001 From: jan Date: Wed, 26 Jun 2024 11:40:03 +0200 Subject: [PATCH] make grade field optional in grade view, make login form handle whitespaces in email --- src/spz/forms/__init__.py | 2 +- .../templates/internal/administration/edit_grade_view.html | 4 +++- src/spz/views.py | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/spz/forms/__init__.py b/src/spz/forms/__init__.py index 1cf80a4..0237a5c 100644 --- a/src/spz/forms/__init__.py +++ b/src/spz/forms/__init__.py @@ -1059,7 +1059,7 @@ class GradeForm(FlaskForm): for applicant in applicants: field_name = f'grade_{applicant.id}' setattr(GradeForm, field_name, - IntegerField("Note", validators=[validators.NumberRange(min=0, max=100)], + IntegerField("Note", validators=[validators.Optional(), validators.NumberRange(min=0, max=100)], default=applicant.grade)) return GradeForm diff --git a/src/spz/templates/internal/administration/edit_grade_view.html b/src/spz/templates/internal/administration/edit_grade_view.html index f4785ee..d62db6b 100644 --- a/src/spz/templates/internal/administration/edit_grade_view.html +++ b/src/spz/templates/internal/administration/edit_grade_view.html @@ -43,7 +43,9 @@

Schritt 2:

{{ applicant.ects_points }} - {% if applicant.grade >= 50 %} + {% if applicant.grade is none %} + - + {% elif applicant.grade >= 50 %}