Merge branch 'staging' into state-machine-error-handling
This commit is contained in:
@@ -9,7 +9,7 @@ from sqlalchemy import (
|
||||
String,
|
||||
)
|
||||
from sqlalchemy.orm import relationship
|
||||
from datetime import date
|
||||
import pendulum
|
||||
|
||||
from atst.models.base import Base
|
||||
import atst.models.mixins as mixins
|
||||
@@ -75,5 +75,5 @@ class CLIN(Base, mixins.TimestampsMixin):
|
||||
@property
|
||||
def is_active(self):
|
||||
return (
|
||||
self.start_date <= date.today() <= self.end_date
|
||||
self.start_date <= pendulum.today() <= self.end_date
|
||||
) and self.task_order.signed_at
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import datetime
|
||||
import pendulum
|
||||
from enum import Enum
|
||||
import secrets
|
||||
|
||||
@@ -90,7 +90,7 @@ class InvitesMixin(object):
|
||||
@property
|
||||
def is_expired(self):
|
||||
return (
|
||||
datetime.datetime.now(self.expiration_time.tzinfo) > self.expiration_time
|
||||
pendulum.now(tz=self.expiration_time.tzinfo) > self.expiration_time
|
||||
and not self.status == Status.ACCEPTED
|
||||
)
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
from enum import Enum
|
||||
from decimal import Decimal
|
||||
|
||||
from sqlalchemy import Column, DateTime, ForeignKey, String
|
||||
from sqlalchemy.ext.hybrid import hybrid_property
|
||||
@@ -141,14 +140,6 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
||||
def total_contract_amount(self):
|
||||
return sum((clin.total_amount for clin in self.clins if clin.total_amount))
|
||||
|
||||
@property
|
||||
def invoiced_funds(self):
|
||||
# TODO: implement this using reporting data from the CSP
|
||||
if self.is_active:
|
||||
return self.total_obligated_funds * Decimal(0.75)
|
||||
else:
|
||||
return 0
|
||||
|
||||
@property
|
||||
def display_status(self):
|
||||
if self.status == Status.UNSIGNED:
|
||||
|
Reference in New Issue
Block a user