premiere iteration de la gestion des documents
CI - Security, Lint & Tests / validate (push) Failing after 1m20s

This commit is contained in:
cedrick2711
2026-09-11 09:51:48 -04:00
parent bd9ed4bdc7
commit abf2f06642
14 changed files with 1326 additions and 5 deletions
+21 -1
View File
@@ -23,7 +23,7 @@ from marshmallow import (
validates_schema,
)
from app.models import ESPORT_GAMES, GAME_PLATFORMS, USER_TYPES
from app.models import DOCUMENT_KINDS, ESPORT_GAMES, GAME_PLATFORMS, USER_TYPES
# =============================================================================
# Custom Validators
@@ -1061,3 +1061,23 @@ class EvaluationSchema(StripMixin):
allow_none=True,
load_default=None,
)
class DocumentCreateSchema(StripMixin):
"""Validate the admin form that creates a new document.
Fields:
title: Human-readable name of the document (e.g. ``Contrat joueur``).
kind: One of DOCUMENT_KINDS. The kind decides who completes the
document and whether completion is a signature or an
acknowledgment.
"""
title = fields.String(
required=True,
validate=validate.Length(min=1, max=255, error=_l('Title is required.')),
)
kind = fields.String(
required=True,
validate=validate.OneOf(DOCUMENT_KINDS, error=_l('That document type is not recognised.')),
)