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).
This commit is contained in:
Imdad Ahad
2016-11-22 16:34:53 +00:00
committed by Paul Craig
parent 0e0dbe6e77
commit 9b6584c8a1

View File

@@ -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 [