premiere iteration de la gestion des documents
CI - Security, Lint & Tests / validate (push) Failing after 1m20s
CI - Security, Lint & Tests / validate (push) Failing after 1m20s
This commit is contained in:
+21
-1
@@ -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.')),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user