From 3913f7ead10b6f98c3f9b4e5882336f75b6f1576 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Fri, 28 Aug 2020 11:25:10 +0100 Subject: fixed some more view bugs related to db redesign --- ctrack/organisations/models.py | 10 ++++------ .../templates/organisations/organisation_detail.html | 2 +- ctrack/organisations/views.py | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'ctrack/organisations') diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py index 1c914b5..f91dabf 100644 --- a/ctrack/organisations/models.py +++ b/ctrack/organisations/models.py @@ -153,20 +153,18 @@ class Organisation(models.Model): return self.person_set.filter(primary_nis_contact=True) def applicable_systems(self): - return self.applicablesystem_set.all() - - def systems(self): + # return self.applicablesystem_set.all() ess = self.essentialservice_set.all() out = [] for es in ess: - out.extend(list(es.systems.all())) + out.extend(es.systems.all()) return out - def systems_for_each_essential_service(self): + def systems(self): ess = self.essentialservice_set.all() out = [] for es in ess: - out.extend(es.systems.all()) + out.extend(list(es.systems.all())) return out diff --git a/ctrack/organisations/templates/organisations/organisation_detail.html b/ctrack/organisations/templates/organisations/organisation_detail.html index 0e981b9..9ece192 100644 --- a/ctrack/organisations/templates/organisations/organisation_detail.html +++ b/ctrack/organisations/templates/organisations/organisation_detail.html @@ -79,7 +79,7 @@ {{ ass.name }} {{ ass.function }}
- + {{ ass.caf }} | Edit System diff --git a/ctrack/organisations/views.py b/ctrack/organisations/views.py index 3f91e2f..7652783 100644 --- a/ctrack/organisations/views.py +++ b/ctrack/organisations/views.py @@ -79,7 +79,7 @@ class OrganisationDetailView(LoginRequiredMixin, PermissionRequiredMixin, Detail context["addr"] = addr people = org.person_set.all() context["people"] = people - applicable_systems = org.systems_for_each_essential_service() + applicable_systems = org.applicable_systems() context["applicable_systems"] = applicable_systems context["engagement_events"] = engagement_events context["essential_services"] = essential_services -- cgit v1.2.3