diff options
Diffstat (limited to 'ctrack/organisations/views.py')
-rw-r--r-- | ctrack/organisations/views.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ctrack/organisations/views.py b/ctrack/organisations/views.py index 1d1978e..5726aa2 100644 --- a/ctrack/organisations/views.py +++ b/ctrack/organisations/views.py @@ -36,8 +36,11 @@ class OrganisationListViewByLeadInspector(ListView): def get_context_data(self, *, object_list=None, **kwargs): context = super().get_context_data(**kwargs) inspector = get_user_model().objects.get(id=self.kwargs.get("id")) - context["organisation_list"] = Organisation.objects.filter(lead_inspector=inspector) + context["organisation_list"] = Organisation.objects.filter( + lead_inspector=inspector, oes=True + ) context["inspector"] = inspector + context["is_oes"] = True return context @@ -52,6 +55,15 @@ def person_detail(request, person_id): return render(request, "organisations/person_detail.html", {"person": p}) +def oes_list(request): + oes = Organisation.objects.filter(oes=True) + return render( + request, + "organisations/organisation_list.html", + {"organisation_list": oes, "is_oes": True}, + ) + + class OrganisationCreate(PermissionRequiredMixin, CreateView): model = Organisation template_name = "organisations/org_create_formset.html" |