Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Solve SQL Alchemy's warnings about absence of PlanoTrabalho in session #161

Merged
merged 3 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* Simplify validation of domain based integers
* Solve pydantic's warnings about deprecated use of methods .json and
.dict
* Solve SQL Alchemy's warnings about absence of PlanoTrabalho in session,
in context of the relationship with Participante


## 3.2.3
Expand Down
3 changes: 2 additions & 1 deletion src/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ async def create_plano_trabalho(
f"matricula_siape: {plano_trabalho.matricula_siape} "
f"cod_unidade_lotacao: {plano_trabalho.cod_unidade_lotacao_participante}"
)
db_plano_trabalho.participante = db_participante
session.add(db_participante)
db_participante.planos_trabalho.append(db_plano_trabalho)

# Relacionamento com Contribuicao
for contribuicao in contribuicoes:
Expand Down
1 change: 1 addition & 0 deletions tests/participantes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ def test_update_participante_with_existing_pt(
input_part = deepcopy(self.input_part)
response = self.put_participante(input_part)
assert response.status_code == status.HTTP_200_OK
self.assert_equal_participante(response.json(), input_part)

def test_update_participante(
self,
Expand Down