aakash9684 commited on
Commit
fa2ee50
·
1 Parent(s): 986980c

Fix 2BHK never generating the master's attached bathroom

Browse files

attached_bathroom is a core room, so it never appears in selected_optional;
the 2BHK generator filtered for it there and so always dropped it. Moved to
its required list, where 3BHK/4BHK already had it.

Files changed (1) hide show
  1. core/pdf_templates_2bhk.py +5 -2
core/pdf_templates_2bhk.py CHANGED
@@ -390,10 +390,13 @@ def generate_bhk2_pdf_population(plot_w: float, plot_h: float,
390
  from . import layout_engine
391
  # no foyer (the 12x10 stair block is the entry); dining + utility are
392
  # compulsory; study is a space-permitting filler when selected
 
 
 
393
  required = ["external_staircase", "living_room", "kitchen",
394
  "dining_room", "utility_area", "master_bedroom",
395
- "bedroom_01", "common_bathroom"]
396
- gopt = [r for r in ("attached_bathroom", "pooja_room", "balcony", "study")
397
  if r in set(selected_optional or [])]
398
  engine_pairs = layout_engine.generate_population(
399
  "2bhk", required, gopt, plot_w, plot_h, road_side, n,
 
390
  from . import layout_engine
391
  # no foyer (the 12x10 stair block is the entry); dining + utility are
392
  # compulsory; study is a space-permitting filler when selected
393
+ # attached_bathroom is a COMMON_ROOM (a core checkbox, on by default),
394
+ # so it never appears in selected_optional — it has to be required here
395
+ # or a 2BHK would silently render without the master's washroom.
396
  required = ["external_staircase", "living_room", "kitchen",
397
  "dining_room", "utility_area", "master_bedroom",
398
+ "bedroom_01", "common_bathroom", "attached_bathroom"]
399
+ gopt = [r for r in ("pooja_room", "balcony", "study")
400
  if r in set(selected_optional or [])]
401
  engine_pairs = layout_engine.generate_population(
402
  "2bhk", required, gopt, plot_w, plot_h, road_side, n,