Fix data.get with default.
This commit is contained in:
parent
892470bdad
commit
16979bfc0b
@ -205,7 +205,7 @@ class AccountResource(Resource):
|
||||
data = self.api.payload
|
||||
|
||||
# Check ID consistency.
|
||||
if data.get('id', default=account_id) != account_id:
|
||||
if data.get('id', account_id) != account_id:
|
||||
ns.abort(406, 'Id must not be provided or changed on update.')
|
||||
|
||||
# Need to get the object to update it.
|
||||
|
@ -185,7 +185,7 @@ class OperationResource(Resource):
|
||||
data = self.api.payload
|
||||
|
||||
# Check ID consistency.
|
||||
if data.get('id', default=operation_id) != operation_id:
|
||||
if data.get('id', operation_id) != operation_id:
|
||||
ns.abort(406, 'Id must not be provided or changed on update.')
|
||||
|
||||
# pylint: disable=no-member
|
||||
|
@ -160,7 +160,7 @@ class ScheduledOperationResource(Resource):
|
||||
so_id = scheduled_operation_id
|
||||
|
||||
# Check ID consistency.
|
||||
if data.get('id', default=so_id) != so_id:
|
||||
if data.get('id', so_id) != so_id:
|
||||
ns.abort(406, 'Id must not be provided or changed on update.')
|
||||
|
||||
scheduled_operation = ScheduledOperation.query().get(so_id)
|
||||
|
Loading…
Reference in New Issue
Block a user