Added is_active and has_mou to Organization model.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2023-11-20 09:43:40 -05:00
parent 901aaed157
commit 33c16bdd1e

View File

@@ -434,6 +434,14 @@ class Organization(db.Model):
def domain_list(self):
return [domain.domain for domain in self.domains]
@property
def is_active(self):
return self.agreement and self.agreement.status == AgreementStatus.active
@property
def has_mou(self):
return self.agreement and self.agreement.type == AgreementType.MOU
def serialize(self):
return {
"id": str(self.id),