Skip to content

Commit

Permalink
Adding hotel_block_name to email context
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbyt3r committed Aug 14, 2024
1 parent 7ffa507 commit b748f6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/tuber/api/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def get_email_context(badge, tables):
hotel_rooms.append({
"roommates": roommates,
"hotel_block": room.hotel_block,
"hotel_block_name": tables['HotelRoomBlock'].get(room.hotel_block).name if room.hotel_block in tables['HotelRoomBlock'] else "unknown",
"messages": room.messages,
"completed": room.completed,
"start_night": start_night,
Expand Down Expand Up @@ -91,6 +92,7 @@ def generate_emails(email):
"HotelRoom": {x.id: x for x in db.query(HotelRoom).filter(HotelRoom.event == email.event)
.options(joinedload(HotelRoom.room_night_assignments))
.options(joinedload(HotelRoom.roommates)).all()},
"HotelRoomBlock": {x.id: x for x in db.query(HotelRoomBlock).filter(HotelRoomBlock.event == email.event).all()},
"Event": event,
}

Expand Down

0 comments on commit b748f6d

Please sign in to comment.