aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/Dawn/models.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/Dawn/models.py b/python/Dawn/models.py
index 95786d11..61129921 100644
--- a/python/Dawn/models.py
+++ b/python/Dawn/models.py
@@ -661,7 +661,11 @@ class Termination(db.Model):
termination_cp = db.Column(
db.String(12),
db.ForeignKey("counterparties.code"),
- info={"choices": [(None, "")], "label": "termination counterparty"},
+ info={
+ "choices": [(None, "")],
+ "label": "termination counterparty",
+ "coerce": lambda s: None if s == "None" else s,
+ },
)
counterparty = db.relationship(Counterparties, foreign_keys=[termination_cp])
termination_amount = db.Column(db.Float)