Closed toconnell closed 3 years ago
This is actually a problem with the return from _get_timelineyear():
Looks like root cause was auto-advancing the LY to a non-existent LY. From the prod logs:
[2020-11-09 00:12:43] INFO: settlements object 'Fireshrine' [5f0b67496515930160fb1858] event: Brianna, Milo, Respite and Venicia returned to the settlement in victory.
[2020-11-09 00:12:43] INFO: settlements object 'Fireshrine' [5f0b67496515930160fb1858] event: jcastle99@gmail.com set settlement current Lantern Year to 31.
[2020-11-09 00:12:43] INFO: Saved settlements object 'Fireshrine' [5f0b67496515930160fb1858] to mdb.settlements successfully!
[2020-11-09 00:12:43] INFO: Saved settlements object 'Fireshrine' [5f0b67496515930160fb1858] to mdb.settlements successfully!
--- a/app/models/settlements.py
+++ b/app/models/settlements.py
@@ -1580,7 +1580,8 @@ class Settlement(models.UserAsset):
# 7.) increment LY, if necessary
if self.params.get('increment_ly', False):
- self.set_current_ly(self.get_current_ly() + 1)
+ if not self.get_current_ly() >= self.get_max_ly():
+ self.set_current_ly(self.get_current_ly() + 1)