File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 Participante ,
2525 Users ,
2626)
27- from util import over_a_year
2827
2928STR_FIELD_MAX_SIZE = 300
3029NON_NEGATIVE_INT4 = Annotated [NonNegativeInt , Field (le = (2 ** 31 ) - 1 )]
@@ -380,15 +379,6 @@ def validate_unidade(self):
380379 )
381380 return self
382381
383- @model_validator (mode = "after" )
384- def year_interval (self ) -> "PlanoTrabalhoSchema" :
385- """Garante que o plano não abrange um período maior que 1 ano."""
386- if over_a_year (self .data_inicio , self .data_termino ) == 1 :
387- raise ValueError (
388- "Plano de trabalho não pode abranger período maior que 1 ano"
389- )
390- return self
391-
392382 @model_validator (mode = "after" )
393383 def must_be_sequential_dates (self ) -> "PlanoTrabalhoSchema" :
394384 "Verifica se a data de início e a data de término estão na ordem esperada."
@@ -573,10 +563,6 @@ def validate_entregas_uniqueness(self) -> "PlanoEntregasSchema":
573563 @model_validator (mode = "after" )
574564 def validate_period (self ) -> "PlanoEntregasSchema" :
575565 """Valida o período do plano de entregas."""
576- if over_a_year (self .data_inicio , self .data_termino ) == 1 :
577- raise ValueError (
578- "Plano de entregas não pode abranger período maior que 1 ano"
579- )
580566 if self .data_termino < self .data_inicio :
581567 raise ValueError ("data_termino deve ser maior ou igual que data_inicio." )
582568 if self .data_avaliacao is not None and self .data_avaliacao < self .data_inicio :
You can’t perform that action at this time.
0 commit comments