diff --git a/accountant/api/views/entries.py b/accountant/api/views/entries.py index 7b1b997..f2c41d9 100644 --- a/accountant/api/views/entries.py +++ b/accountant/api/views/entries.py @@ -84,7 +84,7 @@ class OperationListResource(Resource): session.add(operation) - return Operation.query(session).get(operation.id) + return operation class OperationResource(Resource): @@ -94,7 +94,7 @@ class OperationResource(Resource): """ Get operation. """ - operation = Operation.query(session).get(operation_id) + operation = session.query(Operation).get(operation_id) if not operation: return None, 404 @@ -109,7 +109,7 @@ class OperationResource(Resource): assert (id not in kwargs or kwargs.id is None or kwargs.id == operation_id) - operation = Operation.query(session).get(operation_id) + operation = session.query(Operation).get(operation_id) if not operation: return None, 404 @@ -125,7 +125,7 @@ class OperationResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) def delete(self, operation_id, session): - operation = Operation.query(session).get(operation_id) + operation = session.query(Operation).get(operation_id) if not operation: return None, 404