Improving tests a little.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2023-11-20 12:31:57 -05:00
parent 33c16bdd1e
commit d1dec155b6
3 changed files with 25 additions and 10 deletions

View File

@@ -434,6 +434,18 @@ class Organization(db.Model):
def domain_list(self):
return [domain.domain for domain in self.domains]
@property
def agreement(self):
try:
active_agreements = [
agreement
for agreement in self.agreements
if agreement.status == AgreementStatus.ACTIVE
]
return active_agreements[0]
except IndexError:
return None
@property
def is_active(self):
return self.agreement and self.agreement.status == AgreementStatus.active