Closed toconnell closed 4 years ago
Print debugging shows that it's population throwing the error. Legacy webapp admin asset dump confirms:
population <type 'NoneType'> |None|
diff --git a/app/models/settlements.py b/app/models/settlements.py
index 6a463d7..9559689 100644
--- a/app/models/settlements.py
+++ b/app/models/settlements.py
@@ -3703,7 +3703,13 @@ class Settlement(models.UserAsset):
# Duck Typing!
for attrib in ['survival_limit', 'population', 'death_count']:
- self.settlement[attrib] = int(self.settlement[attrib])
+ try:
+ self.settlement[attrib] = int(self.settlement[attrib])
+ except TypeError:
+ err = 'Illegal %s value: %s! Resetting to zero!'
+ self.log_event(err % (attrib, self.settlement[attrib]))
+ self.settlement[attrib] = 0
+ self.perform_save = True
committed and deployed.
From Twitter:
From the prod API logs: