diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2020-08-27 15:24:15 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2020-08-27 15:24:15 +0100 |
commit | 0b1c397af82abd41e4379bd1f1eab490fe22db38 (patch) | |
tree | 4f1103fdb7b3183d6c26de9975fe94dcccf945cc /ctrack/organisations/views.py | |
parent | de0bbafec7d1aac5aaf9c672678c257b62f14d67 (diff) |
further work trying to get user views working
Diffstat (limited to 'ctrack/organisations/views.py')
-rw-r--r-- | ctrack/organisations/views.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ctrack/organisations/views.py b/ctrack/organisations/views.py index 394966a..3f91e2f 100644 --- a/ctrack/organisations/views.py +++ b/ctrack/organisations/views.py @@ -10,6 +10,7 @@ from ctrack.register.models import EngagementEvent from .forms import AddressInlineFormSet, IncidentReportForm, OrganisationCreateForm from .models import IncidentReport, Organisation, Person +from ctrack.caf.models import EssentialService class PersonListView(LoginRequiredMixin, PermissionRequiredMixin, ListView): @@ -66,6 +67,7 @@ class OrganisationDetailView(LoginRequiredMixin, PermissionRequiredMixin, Detail org = kwargs["object"] peoples = org.person_set.all() engagement_events = EngagementEvent.objects.filter(participants__in=peoples) + essential_services = EssentialService.objects.filter(organisation=org) no_addr = org.addresses.count() if no_addr > 1: context["no_addr"] = no_addr @@ -77,9 +79,10 @@ class OrganisationDetailView(LoginRequiredMixin, PermissionRequiredMixin, Detail context["addr"] = addr people = org.person_set.all() context["people"] = people - applicable_systems = org.applicablesystem_set.all() + applicable_systems = org.systems_for_each_essential_service() context["applicable_systems"] = applicable_systems context["engagement_events"] = engagement_events + context["essential_services"] = essential_services return context |