diff --git a/accountant/api/views/operations.py b/accountant/api/views/operations.py index 591af10..196a22e 100644 --- a/accountant/api/views/operations.py +++ b/accountant/api/views/operations.py @@ -91,11 +91,11 @@ class OperationListResource(Resource): class OperationResource(Resource): @requires_auth @marshal_with_field(Object(resource_fields)) - def get(self, operation_id): + def get(self, id): """ Get operation. """ - operation = db.session.query(Operation).get(operation_id) + operation = db.session.query(Operation).get(id) if not operation: return None, 404 @@ -104,13 +104,13 @@ class OperationResource(Resource): @requires_auth @marshal_with_field(Object(resource_fields)) - def post(self, operation_id): + def post(self, id): kwargs = parser.parse_args() assert (id not in kwargs or kwargs.id is None - or kwargs.id == operation_id) + or kwargs.id == id) - operation = db.session.query(Operation).get(operation_id) + operation = db.session.query(Operation).get(id) if not operation: return None, 404 @@ -125,8 +125,8 @@ class OperationResource(Resource): @requires_auth @marshal_with_field(Object(resource_fields)) - def delete(self, operation_id): - operation = db.session.query(Operation).get(operation_id) + def delete(self, id): + operation = db.session.query(Operation).get(id) if not operation: return None, 404 @@ -137,4 +137,4 @@ class OperationResource(Resource): api_api.add_resource(OperationListResource, "/operations") -api_api.add_resource(OperationResource, "/operations/") +api_api.add_resource(OperationResource, "/operations/")