Allow TOs to be deleted, along with their associated CLINs

This commit is contained in:
richard-dds
2019-08-08 15:30:29 -04:00
parent 334a280610
commit 02900ff771
4 changed files with 44 additions and 2 deletions

View File

@@ -71,3 +71,10 @@ class TaskOrders(BaseDomainClass):
by_time_created = sorted(task_orders, key=lambda to: to.time_created)
by_status = sorted(by_time_created, key=lambda to: SORT_ORDERING.get(to.status))
return by_status
@classmethod
def delete(cls, task_order_id):
task_order = TaskOrders.get(task_order_id)
if task_order:
db.session.delete(task_order)
db.session.commit()