File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -158,11 +158,18 @@ async def create_plano_trabalho(
158
158
db_participante = result .scalars ().unique ().one_or_none ()
159
159
if db_participante is None :
160
160
raise ValueError (
161
- "Plano de Trabalho faz referência a participante inexistente. "
162
- f"origem_unidade: { plano_trabalho .origem_unidade } "
163
- f"cod_unidade_autorizadora: { plano_trabalho .cod_unidade_autorizadora } "
164
- f"matricula_siape: { plano_trabalho .matricula_siape } "
165
- f"cod_unidade_lotacao: { plano_trabalho .cod_unidade_lotacao_participante } "
161
+ "Plano de Trabalho faz referência a participante inexistente.\n "
162
+ f" origem_unidade: { plano_trabalho .origem_unidade } \n "
163
+ f" cod_unidade_autorizadora: { plano_trabalho .cod_unidade_autorizadora } \n "
164
+ f" matricula_siape: { plano_trabalho .matricula_siape } \n "
165
+ f" cod_unidade_lotacao: { plano_trabalho .cod_unidade_lotacao_participante } "
166
+ )
167
+ if plano_trabalho .data_inicio < db_participante .data_assinatura_tcr :
168
+ raise ValueError (
169
+ "data_inicio do Plano de Trabalho deve ser maior ou igual à "
170
+ "data_assinatura_tcr do Participante.\n "
171
+ f" data_inicio: { plano_trabalho .data_inicio } \n "
172
+ f" data_assinatura_tcr: { db_participante .data_assinatura_tcr } "
166
173
)
167
174
session .add (db_participante )
168
175
db_participante .planos_trabalho .append (db_plano_trabalho )
You can’t perform that action at this time.
0 commit comments