Formatting
This commit is contained in:
@@ -5,7 +5,6 @@ from .exceptions import NotFoundError
|
||||
|
||||
|
||||
class PENumbers(object):
|
||||
|
||||
def __init__(self, db_session):
|
||||
self.db_session = db_session
|
||||
|
||||
@@ -19,8 +18,7 @@ class PENumbers(object):
|
||||
def create_many(self, list_of_pe_numbers):
|
||||
stmt = insert(PENumber).values(list_of_pe_numbers)
|
||||
do_update = stmt.on_conflict_do_update(
|
||||
index_elements=["number"],
|
||||
set_=dict(description=stmt.excluded.description)
|
||||
index_elements=["number"], set_=dict(description=stmt.excluded.description)
|
||||
)
|
||||
self.db_session.execute(do_update)
|
||||
self.db_session.commit()
|
||||
|
@@ -102,7 +102,9 @@ class Requests(object):
|
||||
request.body = deep_merge(request_delta, request.body)
|
||||
|
||||
if Requests.should_allow_submission(request):
|
||||
request.status_events.append(RequestStatusEvent(new_status="pending_submission"))
|
||||
request.status_events.append(
|
||||
RequestStatusEvent(new_status="pending_submission")
|
||||
)
|
||||
|
||||
# Without this, sqlalchemy won't notice the change to request.body,
|
||||
# since it doesn't track dictionary mutations by default.
|
||||
|
@@ -5,13 +5,14 @@ from .exceptions import NotFoundError
|
||||
|
||||
|
||||
class TaskOrders(object):
|
||||
|
||||
def __init__(self, db_session):
|
||||
self.db_session = db_session
|
||||
|
||||
def get(self, order_number):
|
||||
try:
|
||||
task_order = self.db_session.query(TaskOrder).filter_by(number=order_number).one()
|
||||
task_order = (
|
||||
self.db_session.query(TaskOrder).filter_by(number=order_number).one()
|
||||
)
|
||||
except NoResultFound:
|
||||
raise NotFoundError("task_order")
|
||||
|
||||
|
Reference in New Issue
Block a user