Skip to content

Commit

Permalink
Added flush and refresh back in (#98)
Browse files Browse the repository at this point in the history
Switched code back to using flush and refresh. The new mapping table and
DAO seems to need it to fully build out the FI object being returned.
  • Loading branch information
jcadam14 authored Jan 19, 2024
1 parent e45b4b7 commit fe34b42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/entities/repos/institutions_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ async def upsert_institution(session: AsyncSession, fi: FinancialInstitutionDto)
fi_data["sbl_institution_types"] = types_association

db_fi = await session.merge(FinancialInstitutionDao(**fi_data))
return await session.get(FinancialInstitutionDao, db_fi.lei)
await session.flush()
await session.refresh(db_fi)
return db_fi


async def add_domains(
Expand Down

0 comments on commit fe34b42

Please sign in to comment.