diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index f40d153d..4f386813 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -1478,7 +1478,7 @@ class Offer(JoinedTableMixin, ActionWithMultipleDevices): user_to = db.relationship(User, primaryjoin=user_to_id == User.id) user_to_comment = """The user that gets the device due this deal.""" price = Column(Float(decimal_return_scale=2), nullable=True) - currency = Column(DBEnum(Currency), nullable=False, default='EUR') + currency = Column(DBEnum(Currency), nullable=False, default=Currency.EUR.name) currency.comment = """The currency of this price as for ISO 4217.""" date = Column(db.TIMESTAMP(timezone=True)) document_id = Column(CIText()) diff --git a/ereuse_devicehub/resources/action/schemas.py b/ereuse_devicehub/resources/action/schemas.py index 41f26736..748c8ecd 100644 --- a/ereuse_devicehub/resources/action/schemas.py +++ b/ereuse_devicehub/resources/action/schemas.py @@ -458,9 +458,9 @@ class CancelReservation(Organize): class Trade(ActionWithMultipleDevices): __doc__ = m.Trade.__doc__ - accepted_by_from = Boolean(missing=False, description=m.Offer.accepted_by_from.comment) - accepted_by_to = Boolean(missing=False, description=m.Offer.accepted_by_to.comment) - confirm_transfer = Boolean(missing=False, description=m.Offer.confirm_transfer.comment) + accepted_by_from = Boolean(missing=False, description=m.Trade.accepted_by_from.comment) + accepted_by_to = Boolean(missing=False, description=m.Trade.accepted_by_to.comment) + confirm_transfer = Boolean(missing=False, description=m.Trade.confirm_transfer.comment) offer = NestedOn('Offer', dump_only=True) @@ -491,7 +491,6 @@ class Offer(Trade): data['user_from_id'] = user_to.id - class InitTransfer(Trade): __doc__ = m.InitTransfer.__doc__