mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-23 07:46:06 -04:00
@@ -448,13 +448,17 @@ class Organization(db.Model):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def agreement_active(self):
|
def agreement_active(self):
|
||||||
return (
|
try:
|
||||||
self.agreement.status == AgreementStatus.active if self.agreement else False
|
return self.agreement.status == AgreementStatus.ACTIVE
|
||||||
)
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def has_mou(self):
|
def has_mou(self):
|
||||||
return self.agreement.type == AgreementType.MOU if self.agreement else False
|
try:
|
||||||
|
return self.agreement.type == AgreementType.MOU
|
||||||
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -452,7 +452,7 @@ def test_organization_agreement_active(notify_db_session, agreement_status, expe
|
|||||||
agree.type = AgreementType.IAA
|
agree.type = AgreementType.IAA
|
||||||
organization = create_organization(name="Something")
|
organization = create_organization(name="Something")
|
||||||
organization.agreements.append(agree)
|
organization.agreements.append(agree)
|
||||||
assert organization.active == expected
|
assert organization.agreement_active == expected
|
||||||
|
|
||||||
|
|
||||||
def test_agreement_serialize():
|
def test_agreement_serialize():
|
||||||
|
|||||||
Reference in New Issue
Block a user