Compare commits
No commits in common. "develop" and "master" have entirely different histories.
@ -195,7 +195,7 @@ class Account(db.Model):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if end:
|
if end:
|
||||||
query = query.filter(base_query.c.operation_date <= str(end))
|
query = query.filter(query.c.operation_date <= str(end))
|
||||||
|
|
||||||
elif end:
|
elif end:
|
||||||
query = query.filter(Operation.operation_date <= str(end))
|
query = query.filter(Operation.operation_date <= str(end))
|
||||||
|
@ -24,8 +24,6 @@ def users():
|
|||||||
|
|
||||||
|
|
||||||
@users.command()
|
@users.command()
|
||||||
@click.argument('email')
|
|
||||||
@click.argument('password')
|
|
||||||
def add(email, password):
|
def add(email, password):
|
||||||
""" Add a new user. """
|
""" Add a new user. """
|
||||||
user = User()
|
user = User()
|
||||||
|
@ -122,7 +122,7 @@ range_parser.add_argument(
|
|||||||
|
|
||||||
|
|
||||||
# pylint: disable=no-self-use
|
# pylint: disable=no-self-use
|
||||||
@ns.route('')
|
@ns.route('/')
|
||||||
@ns.doc(
|
@ns.doc(
|
||||||
security='apikey',
|
security='apikey',
|
||||||
responses={
|
responses={
|
||||||
@ -205,7 +205,7 @@ class AccountResource(Resource):
|
|||||||
data = self.api.payload
|
data = self.api.payload
|
||||||
|
|
||||||
# Check ID consistency.
|
# Check ID consistency.
|
||||||
if data.get('id', account_id) != account_id:
|
if data.get('id', default=account_id) != account_id:
|
||||||
ns.abort(406, 'Id must not be provided or changed on update.')
|
ns.abort(406, 'Id must not be provided or changed on update.')
|
||||||
|
|
||||||
# Need to get the object to update it.
|
# Need to get the object to update it.
|
||||||
|
@ -90,7 +90,7 @@ account_range_parser.add_argument(
|
|||||||
|
|
||||||
|
|
||||||
# pylint: disable=no-self-use
|
# pylint: disable=no-self-use
|
||||||
@ns.route('')
|
@ns.route('/')
|
||||||
@ns.doc(
|
@ns.doc(
|
||||||
security='apikey',
|
security='apikey',
|
||||||
responses={
|
responses={
|
||||||
@ -143,8 +143,6 @@ class OperationListResource(Resource):
|
|||||||
|
|
||||||
db.session.add(operation) # pylint: disable=no-member
|
db.session.add(operation) # pylint: disable=no-member
|
||||||
|
|
||||||
db.session.commit()
|
|
||||||
|
|
||||||
return operation, 201
|
return operation, 201
|
||||||
|
|
||||||
|
|
||||||
@ -187,7 +185,7 @@ class OperationResource(Resource):
|
|||||||
data = self.api.payload
|
data = self.api.payload
|
||||||
|
|
||||||
# Check ID consistency.
|
# Check ID consistency.
|
||||||
if data.get('id', operation_id) != operation_id:
|
if data.get('id', default=operation_id) != operation_id:
|
||||||
ns.abort(406, 'Id must not be provided or changed on update.')
|
ns.abort(406, 'Id must not be provided or changed on update.')
|
||||||
|
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
@ -205,8 +203,6 @@ class OperationResource(Resource):
|
|||||||
|
|
||||||
db.session.merge(operation) # pylint: disable=no-member
|
db.session.merge(operation) # pylint: disable=no-member
|
||||||
|
|
||||||
db.session.commit()
|
|
||||||
|
|
||||||
return operation, 200
|
return operation, 200
|
||||||
|
|
||||||
@ns.response(204, 'Operation deleted', operation_model)
|
@ns.response(204, 'Operation deleted', operation_model)
|
||||||
|
@ -68,7 +68,7 @@ account_id_parser.add_argument(
|
|||||||
|
|
||||||
|
|
||||||
# pylint: disable=no-self-use
|
# pylint: disable=no-self-use
|
||||||
@ns.route('')
|
@ns.route('/')
|
||||||
@ns.doc(
|
@ns.doc(
|
||||||
security='apikey',
|
security='apikey',
|
||||||
responses={
|
responses={
|
||||||
@ -160,7 +160,7 @@ class ScheduledOperationResource(Resource):
|
|||||||
so_id = scheduled_operation_id
|
so_id = scheduled_operation_id
|
||||||
|
|
||||||
# Check ID consistency.
|
# Check ID consistency.
|
||||||
if data.get('id', so_id) != so_id:
|
if data.get('id', default=so_id) != so_id:
|
||||||
ns.abort(406, 'Id must not be provided or changed on update.')
|
ns.abort(406, 'Id must not be provided or changed on update.')
|
||||||
|
|
||||||
scheduled_operation = ScheduledOperation.query().get(so_id)
|
scheduled_operation = ScheduledOperation.query().get(so_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user