From f9acff50d1bfde27203ade32629f30e360146679 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Mon, 15 Jun 2015 13:05:52 +0200 Subject: [PATCH] Removed default value for session. --- accountant/api/views/accounts.py | 10 +++++----- accountant/api/views/entries.py | 10 +++++----- accountant/api/views/scheduled_operations.py | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/accountant/api/views/accounts.py b/accountant/api/views/accounts.py index 376b585..92f2943 100644 --- a/accountant/api/views/accounts.py +++ b/accountant/api/views/accounts.py @@ -71,7 +71,7 @@ date_parser.add_argument('end', class AccountListResource(Resource): @session_aware @marshal_with_field(fields.List(Object(resource_fields))) - def get(self, session=None): + def get(self, session): """ Returns accounts with their balances. """ @@ -85,7 +85,7 @@ class AccountListResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def post(self, session=None): + def post(self, session): """ Create a new account. """ @@ -107,7 +107,7 @@ class AccountListResource(Resource): class AccountResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def get(self, account_id, session=None): + def get(self, account_id, session): """ Get account. """ @@ -120,7 +120,7 @@ class AccountResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def delete(self, account_id, session=None): + def delete(self, account_id, session): try: account = Account.get(session, account_id) except NoResultFound: @@ -135,7 +135,7 @@ class AccountResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def put(self, account_id, session=None): + def put(self, account_id, session): kwargs = parser.parse_args() assert (id not in kwargs or kwargs.id is None diff --git a/accountant/api/views/entries.py b/accountant/api/views/entries.py index 1b34f7b..0bdff97 100644 --- a/accountant/api/views/entries.py +++ b/accountant/api/views/entries.py @@ -64,7 +64,7 @@ range_parser.add_argument('end', type=lambda a: dateutil.parser.parse(a)) class EntryListResource(Resource): @session_aware @marshal_with_field(fields.List(Object(resource_fields))) - def get(self, session=None): + def get(self, session): kwargs = range_parser.parse_args() return Operation.get_for_account_and_range(session, **kwargs).all() @@ -74,7 +74,7 @@ class EntryListResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def post(self, session=None): + def post(self, session): kwargs = parser.parse_args() entry = Entry(**kwargs) @@ -87,7 +87,7 @@ class EntryListResource(Resource): class EntryResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def get(self, entry_id, session=None): + def get(self, entry_id, session): """ Get entry. """ @@ -98,7 +98,7 @@ class EntryResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def put(self, entry_id, session=None): + def put(self, entry_id, session): kwargs = parser.parse_args() assert (id not in kwargs or kwargs.id is None @@ -119,7 +119,7 @@ class EntryResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def delete(self, entry_id, session=None): + def delete(self, entry_id, session): try: entry = Entry.get(session, entry_id) except NoResultFound: diff --git a/accountant/api/views/scheduled_operations.py b/accountant/api/views/scheduled_operations.py index a110037..c89a9f0 100644 --- a/accountant/api/views/scheduled_operations.py +++ b/accountant/api/views/scheduled_operations.py @@ -79,7 +79,7 @@ parser.add_argument('account_id', type=int) class ScheduledOperationListResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def put(self, session=None): + def put(self, session): """ Add a new scheduled operation. """ @@ -95,7 +95,7 @@ class ScheduledOperationListResource(Resource): class ScheduledOperationResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def get(self, scheduled_operation_id, session=None): + def get(self, scheduled_operation_id, session): """ Get scheduled operation. """ @@ -106,7 +106,7 @@ class ScheduledOperationResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def delete(self, scheduled_operation_id, session=None): + def delete(self, scheduled_operation_id, session): try: scheduled_operation = ScheduledOperation.get( session, scheduled_operation_id) @@ -119,7 +119,7 @@ class ScheduledOperationResource(Resource): @session_aware @marshal_with_field(Object(resource_fields)) - def put(self, scheduled_operation_id, session=None): + def put(self, scheduled_operation_id, session): kwargs = parser.parse_args() assert (id not in kwargs or kwargs.id is None