Bénévole : retrait de la taille de t-shirt et du régime alimentaire
Champs `tshirt_size` et `diet` supprimés du modèle `Volunteer`, des schémas d'API, de l'import CSV/Excel (mapping, suggestions, exécution) et du jeu de démonstration. Énum `TshirtSize` et helper `parse_tshirt_size` supprimés. Migration 0005. Clé i18n `import.row.invalid_tshirt_size` retirée. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017uUsRg7XzopkCPWimwg9ZM
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
ccf3438eef
commit
609514369a
@@ -12,7 +12,7 @@ from app.importing.schemas import (
|
||||
RowReport,
|
||||
)
|
||||
from app.importing.text import normalize, slug_code, split_skills
|
||||
from app.importing.values import parse_availability_cell, parse_tshirt_size
|
||||
from app.importing.values import parse_availability_cell
|
||||
from app.models import (
|
||||
Availability,
|
||||
DayPart,
|
||||
@@ -29,8 +29,6 @@ _FIELD_HINTS: dict[str, tuple[str, ...]] = {
|
||||
"first_name": ("prenom", "first name", "firstname", "given name"),
|
||||
"last_name": ("nom", "last name", "lastname", "surname", "famille"),
|
||||
"phone": ("tel", "phone", "portable", "mobile", "gsm"),
|
||||
"tshirt_size": ("tshirt", "t shirt", "taille", "shirt"),
|
||||
"diet": ("regime", "alimentaire", "diet", "allergie"),
|
||||
"comment": ("commentaire", "remarque", "note", "precision"),
|
||||
"skills": ("competence", "skill", "habilitation", "brevet", "diplome"),
|
||||
}
|
||||
@@ -82,7 +80,7 @@ def validate_mapping(
|
||||
)
|
||||
)
|
||||
|
||||
for field in ("email", "phone", "tshirt_size", "diet", "comment", "skills"):
|
||||
for field in ("email", "phone", "comment", "skills"):
|
||||
header = getattr(columns, field)
|
||||
if header and header not in headers:
|
||||
errors.append(
|
||||
@@ -281,25 +279,8 @@ def run_import(
|
||||
volunteer.email = email_raw or None
|
||||
if columns.phone:
|
||||
volunteer.phone = (row.get(columns.phone) or "").strip() or None
|
||||
if columns.diet:
|
||||
volunteer.diet = (row.get(columns.diet) or "").strip() or None
|
||||
if columns.comment:
|
||||
volunteer.comment = (row.get(columns.comment) or "").strip() or None
|
||||
if columns.tshirt_size:
|
||||
raw_size = (row.get(columns.tshirt_size) or "").strip()
|
||||
if raw_size:
|
||||
size = parse_tshirt_size(raw_size)
|
||||
if size is None:
|
||||
entry.issues.append(
|
||||
Issue(
|
||||
code="import.row.invalid_tshirt_size",
|
||||
severity="WARNING",
|
||||
field="tshirt_size",
|
||||
params={"value": raw_size},
|
||||
)
|
||||
)
|
||||
else:
|
||||
volunteer.tshirt_size = size
|
||||
|
||||
session.flush()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user