mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-04 16:11:11 -04:00
Fix adding a service when organisation is unknown
An ‘unknown’ organisation can either be: - one where we know it exists but don’t know much about it (in which case the API returns some JSON with the info we do know) - one we’ve never come across (in which case the API will return `None`) This commit fixes a bug where we were trying to access the organisation type in the latter case.
This commit is contained in:
@@ -25,7 +25,11 @@ class Organisation(JSONModel):
|
||||
super().__init__(_dict)
|
||||
|
||||
if self._dict == {}:
|
||||
self.name, self.crown, self.agreement_signed, self.domains = None, None, None, []
|
||||
self.name = None
|
||||
self.crown = None
|
||||
self.agreement_signed = None
|
||||
self.domains = []
|
||||
self.organisation_type = None
|
||||
|
||||
def as_human_readable(self, fallback_domain):
|
||||
if 'dwp.' in ''.join(self.domains):
|
||||
|
||||
Reference in New Issue
Block a user