diff options
Diffstat (limited to 'ctrack/organisations/models.py')
-rw-r--r-- | ctrack/organisations/models.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py index 9eb0a23..f91dabf 100644 --- a/ctrack/organisations/models.py +++ b/ctrack/organisations/models.py @@ -153,7 +153,19 @@ class Organisation(models.Model): return self.person_set.filter(primary_nis_contact=True) def applicable_systems(self): - return self.applicablesystem_set.all() + # return self.applicablesystem_set.all() + ess = self.essentialservice_set.all() + out = [] + for es in ess: + out.extend(es.systems.all()) + return out + + def systems(self): + ess = self.essentialservice_set.all() + out = [] + for es in ess: + out.extend(list(es.systems.all())) + return out class Address(models.Model): |