diff --git a/atst/models/task_order.py b/atst/models/task_order.py index 170e3be4..a139a34f 100644 --- a/atst/models/task_order.py +++ b/atst/models/task_order.py @@ -106,13 +106,16 @@ class TaskOrder(Base, mixins.TimestampsMixin): @property def is_submitted(self): - return ( self.number is not None and self.start_date is not None and self.end_date is not None ) + @property + def is_active(self): + return self.status == Status.ACTIVE + @property def status(self): if self.is_submitted: diff --git a/templates/portfolios/header.html b/templates/portfolios/header.html index 9bbe4132..5e3bd508 100644 --- a/templates/portfolios/header.html +++ b/templates/portfolios/header.html @@ -20,7 +20,7 @@ {{ Icon('info') }} - {{ portfolio.task_orders | sum(attribute='budget') | dollars }} + {{ portfolio.task_orders | selectattr('is_active') | sum(attribute='budget') | dollars }}