Removed default value for session.
This commit is contained in:
parent
278fa7f816
commit
f9acff50d1
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user