aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations/views.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-21 16:09:05 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-21 16:09:05 +0100
commitcbddf7c7fad44f62b1cf057158bcf9e53f8e1bb4 (patch)
treeed3eb1783d7a0a73561a081e23cb5839ecb0bffb /ctrack/organisations/views.py
parentcadbccdf61525c67107ab0f1b1206f4d5e07861a (diff)
now have an OES-only organisation page
Diffstat (limited to 'ctrack/organisations/views.py')
-rw-r--r--ctrack/organisations/views.py14
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"