Closed toconnell closed 6 years ago
Yeah, looks like some joker removed all quarries and broke the website. Good for him. Fixing this now...
Added some graceful failures for smart-asses and trouble-makers:
@@ -3075,7 +3113,7 @@ class Settlement(Models.UserAsset):
# now convert our list into a set (just in case) and then go on to
# remove anything we've already got present in the settlement
option_set = set(options)
- for n in self.settlement[monster_type]:
+ for n in self.settlement.get(monster_type, []):
if n in option_set:
option_set.remove(n)
@@ -3128,13 +3166,13 @@ class Settlement(Models.UserAsset):
candidate_handles = []
if context == "showdown_options":
- candidate_handles.extend(self.settlement["quarries"])
+ candidate_handles.extend(self.settlement.get("quarries", []))
elif context == "nemesis_encounters":
- candidate_handles.extend(self.settlement["nemesis_monsters"])
+ candidate_handles.extend(self.settlement.get("nemesis_monsters", []))
candidate_handles.append(self.campaign.final_boss)
elif context == "defeated_monsters":
- candidate_handles.extend(self.settlement["quarries"])
- candidate_handles.extend(self.settlement["nemesis_monsters"])
+ candidate_handles.extend(self.settlement.get("quarries", []))
+ candidate_handles.extend(self.settlement.get("nemesis_monsters",[]))
candidate_handles.extend(self.get_special_showdowns())
candidate_handles.append(self.campaign.final_boss)
elif context == "special_showdown_options":
From production email alerts: