Skip to content

Commit

Permalink
[ROMM-1154] fix setting main sibling
Browse files Browse the repository at this point in the history
  • Loading branch information
gantoine committed Sep 2, 2024
1 parent a11dc74 commit ae05c6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/handler/database/roms_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ def update_rom_user(self, id: int, data: dict, session: Session = None) -> RomUs
rom_user = self.get_rom_user_by_id(id)

if data["is_main_sibling"]:
rom = self.get_rom(rom_user.rom_id)

session.execute(
update(RomUser)
.where(
and_(
RomUser.rom_id.in_(
[rom.id for rom in rom_user.rom.get_sibling_roms()]
),
RomUser.rom_id.in_(r.id for r in rom.sibling_roms),
RomUser.user_id == rom_user.user_id,
)
)
Expand Down

0 comments on commit ae05c6b

Please sign in to comment.