Minor updates
This commit is contained in:
parent
552c2a4166
commit
4bdf9502d6
|
@ -72,8 +72,7 @@ class Lot(Thing):
|
||||||
transfer_state.comment = TransferState.__doc__
|
transfer_state.comment = TransferState.__doc__
|
||||||
receiver_id = db.Column(CIText(),
|
receiver_id = db.Column(CIText(),
|
||||||
db.ForeignKey(User.ethereum_address),
|
db.ForeignKey(User.ethereum_address),
|
||||||
nullable=True,
|
nullable=True)
|
||||||
default=lambda: g.user.ethereum_address)
|
|
||||||
receiver = db.relationship(User, primaryjoin=receiver_id == User.ethereum_address)
|
receiver = db.relationship(User, primaryjoin=receiver_id == User.ethereum_address)
|
||||||
delivery_note_address = db.Column(CIText(), nullable=True)
|
delivery_note_address = db.Column(CIText(), nullable=True)
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class LotView(View):
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def patch(self, id):
|
def patch(self, id):
|
||||||
patch_schema = self.resource_def.SCHEMA(only=('name', 'description', 'transfer_state', 'receiver', 'deposit'), partial=True)
|
patch_schema = self.resource_def.SCHEMA(only=('name', 'description', 'transfer_state', 'receiver_id', 'deposit', 'delivery_note_address'), partial=True)
|
||||||
l = request.get_json(schema=patch_schema)
|
l = request.get_json(schema=patch_schema)
|
||||||
lot = Lot.query.filter_by(id=id).one()
|
lot = Lot.query.filter_by(id=id).one()
|
||||||
for key, value in l.items():
|
for key, value in l.items():
|
||||||
|
|
Reference in New Issue