From 9b6584c8a1c0e5c51ae25d4a4c36bc0554037f48 Mon Sep 17 00:00:00 2001 From: Imdad Ahad Date: Tue, 22 Nov 2016 16:34:53 +0000 Subject: [PATCH] Make result of `notification.cost()` into a float Cost was returning a `Decimal`, which jsonify doesn't like. Making it a float fixes the problem. [Relevant issue on github](https://github.com/pallets/flask/issues/835). --- app/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index eaebdfc03..b880ccf40 100644 --- a/app/models.py +++ b/app/models.py @@ -557,7 +557,7 @@ class Notification(db.Model): desc(ProviderRates.valid_from) ).limit(1).one() - return provider_rate.rate * self.billable_units + return float(provider_rate.rate * self.billable_units) def completed_at(self): if self.status in [