diff --git a/accountant/api/views/scheduled_operations.py b/accountant/api/views/scheduled_operations.py index 6c4cc2a..658477e 100644 --- a/accountant/api/views/scheduled_operations.py +++ b/accountant/api/views/scheduled_operations.py @@ -91,25 +91,25 @@ class ScheduledOperationListResource(Resource): class ScheduledOperationResource(Resource): @marshal_with_field(Object(resource_fields)) - def get(self, scheduled_operation_id): + def get(self, id): """ Get scheduled operation. """ try: return ScheduledOperation.query().filter( - ScheduledOperation.id == scheduled_operation_id + ScheduledOperation.id == id ).one() except NoResultFound: return None, 404 @marshal_with_field(Object(resource_fields)) - def delete(self, scheduled_operation_id): + def delete(self, id): """ Delete a scheduled operation. """ try: scheduled_operation = ScheduledOperation.query().filter( - ScheduledOperation.id == scheduled_operation_id + ScheduledOperation.id == id ).one() except NoResultFound: return None, 404 @@ -132,18 +132,18 @@ class ScheduledOperationResource(Resource): return None, 204 @marshal_with_field(Object(resource_fields)) - def post(self, scheduled_operation_id): + def post(self, id): """ Update a scheduled operation. """ kwargs = parser.parse_args() assert (id not in kwargs or kwargs.id is None - or kwargs.id == scheduled_operation_id) + or kwargs.id == id) try: scheduled_operation = ScheduledOperation.query().filter( - ScheduledOperation.id == scheduled_operation_id + ScheduledOperation.id == id ).one() except NoResultFound: return None, 404 @@ -163,4 +163,4 @@ class ScheduledOperationResource(Resource): api_api.add_resource(ScheduledOperationListResource, "/scheduled_operations") api_api.add_resource(ScheduledOperationResource, - "/scheduled_operations/") + "/scheduled_operations/")