mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 07:18:58 -04:00
Remove dependence on domains.yml from settings
Settings looked at `domains.yml` when users were making go live requests or email branding requests. This will allow us to remove the `domains.yml` file, by using information about organisations that is now stored in the database instead.
This commit is contained in:
@@ -31,13 +31,12 @@ class Organisation(JSONModel):
|
||||
def crown_status(self):
|
||||
return self.crown
|
||||
|
||||
@property
|
||||
def as_human_readable(self):
|
||||
def as_human_readable(self, fallback_domain):
|
||||
if 'dwp.' in ''.join(self.domains):
|
||||
return 'DWP - Requires OED approval'
|
||||
if self.agreement_signed:
|
||||
return 'Yes, on behalf of {}'.format(self.name)
|
||||
elif self.owner:
|
||||
elif self.name:
|
||||
return '{} (organisation is {}, {})'.format(
|
||||
{
|
||||
False: 'No',
|
||||
@@ -51,11 +50,10 @@ class Organisation(JSONModel):
|
||||
}.get(self.crown_status),
|
||||
)
|
||||
else:
|
||||
return 'Can’t tell (domain is {})'.format(self._domain)
|
||||
return 'Can’t tell (domain is {})'.format(fallback_domain)
|
||||
|
||||
@property
|
||||
def as_info_for_branding_request(self):
|
||||
return self.owner or 'Can’t tell (domain is {})'.format(self._domain)
|
||||
def as_info_for_branding_request(self, fallback_domain):
|
||||
return self.name or 'Can’t tell (domain is {})'.format(fallback_domain)
|
||||
|
||||
@property
|
||||
def as_jinja_template(self):
|
||||
|
||||
@@ -396,10 +396,6 @@ class Service(JSONModel):
|
||||
organisations_client.get_service_organisation(self.id)
|
||||
)
|
||||
|
||||
@property
|
||||
def organisation_name(self):
|
||||
return self.organisation.name
|
||||
|
||||
@cached_property
|
||||
def inbound_number(self):
|
||||
return inbound_number_client.get_inbound_sms_number_for_service(self.id)['data'].get('number', '')
|
||||
|
||||
Reference in New Issue
Block a user