aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-20 15:15:46 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-20 15:15:46 +0100
commit98f6ce0fa2ce5692f578a98922f50aa79fd46bdd (patch)
tree0ca0a402c515c9ebbc741a06acd28729b6a86b9a /ctrack/organisations
parente4c95417112ffe8ba684b4f1d7bd957f87b2f2ed (diff)
func can do deputy_lead_inspectors
Diffstat (limited to 'ctrack/organisations')
-rw-r--r--ctrack/organisations/views.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ctrack/organisations/views.py b/ctrack/organisations/views.py
index 45a86bb..82347e6 100644
--- a/ctrack/organisations/views.py
+++ b/ctrack/organisations/views.py
@@ -145,7 +145,10 @@ class IncidentReportCreateView(FormView):
return HttpResponseRedirect(reverse("core:home"))
-def inspectors_for_each_mode(lead_type="lead_inspector") -> Dict[str, List[str]]:
+def inspectors_for_each_mode(lead_type="lead_inspector") -> Dict[str, Set[str]]:
+ """
+ We want to be able to group lead inspectors by submode.
+ """
if lead_type not in ["lead_inspector", "deputy_lead_inspector"]:
raise ValueError("Can only query for lead_inspector and deputy_lead_inspector attributes.")
submodes = Submode.objects.all()
@@ -155,6 +158,6 @@ def inspectors_for_each_mode(lead_type="lead_inspector") -> Dict[str, List[str]]
orgs = sm.organisation_set.all()
for org in orgs:
insp.add(getattr(org, lead_type))
- out[sm.descriptor] = list(insp)
+ out[sm.descriptor] = insp
del insp
return out