Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
4 changed files with 15 additions and 5 deletions
Showing only changes of commit ebd7d30176 - Show all commits

View File

@ -41,6 +41,8 @@ from wtforms import (
class AjoutAssiduiteEtudForm(FlaskForm):
"Formulaire de saisie d'une assiduité pour un étudiant"
error_message = "" # used to report our errors
assi_etat = RadioField(
"Signaler:",
choices=[("absent", "absence"), ("retard", "retard"), ("present", "présence")],

View File

@ -1203,6 +1203,16 @@ span.wtf-field ul.errors li,
span.wtf-field-error {
color: red;
}
div.wtf-error-messages {
color: red;
font-size: 110%;
font-weight: bold;
border: 1px solid red;
border-radius: 8px;
background-color: yellow;
padding: 12px;
margin: 12px;
}
#bonus_description {
color: rgb(6, 73, 6);

View File

@ -53,11 +53,9 @@ div.submit > input {
<div class="tab-content">
<h2>Signaler une absence, retard ou présence pour {{etud.html_link_fiche()|safe}}</h2>
{% if 'general_errors' in form.errors %}
{% if form.error_message %}
<div class="wtf-error-messages">
{% for error in form.errors['general_errors'] %}
<span>{{ error }}</span>
{% endfor %}
{{ form.error_message }}
</div>
{% endif %}

View File

@ -442,7 +442,7 @@ def _record_assiduite_etud(
db.session.commit()
return True
except ScoValueError as exc:
form.errors["general_errors"] = [f"Erreur: {exc.args[0]}"]
form.error_message = f"Erreur: {exc.args[0]}"
return False
# # Génération de la page