Open toconnell opened 3 years ago
Phase one of deprecating this is only calling it when we're processing a legacy settlement:
@@ -352,7 +368,9 @@ class Settlement(models.UserAsset):
self.bug_fixes()
self.baseline()
- self.migrate_settlement_notes()
+
+ if self.settlement.get("settlement_notes", None) is not None:
+ self.migrate_settlement_notes()
#
@@ -4474,6 +4492,8 @@ class Settlement(models.UserAsset):
as a proper settlement_note document in mdb. """
if self.settlement.get("settlement_notes", None) is None:
+ err = "%s Does not have 'settlement_notes' key! Cannot migrate..."
+ self.logger.warn(err % self)
return True
else:
self.logger.debug("Converting legacy 'settlement_notes' to mdb.settlement_notes doc!")
These warnings are chewing up a bunch of logs: we need a cut-off, after which we don't check old settlement notes.