|
@@ -27,7 +27,7 @@ class IndexView(MultiplePermissionsRequi
|
|
|
|
|
|
# Required permissions.
|
|
|
permissions = {
|
|
|
"all": ("conntrackt.view", "conntrackt.view",),
|
|
|
"all": ("conntrackt.view",),
|
|
|
}
|
|
|
# Raise authorisation denied exception for unmet permissions.
|
|
|
raise_exception = True
|
|
@@ -44,9 +44,11 @@ class IndexView(MultiplePermissionsRequi
|
|
|
# Set the context using the parent class.
|
|
|
context = super(IndexView, self).get_context_data(**kwargs)
|
|
|
|
|
|
# Store information about all projcts in context. Optimise database
|
|
|
# access for the view.
|
|
|
context['projects'] = Project.objects.all().prefetch_related('entity_set').order_by('name')
|
|
|
# Store information about all projcts in context.
|
|
|
context['projects'] = Project.objects.all().order_by('name')
|
|
|
|
|
|
# Store information about all locations in context.
|
|
|
context['locations'] = Location.objects.all().order_by('name')
|
|
|
|
|
|
return context
|
|
|
|
|
@@ -59,7 +61,7 @@ class ProjectView(MultiplePermissionsReq
|
|
|
model = Project
|
|
|
|
|
|
permissions = {
|
|
|
"all": ("conntrackt.view", "conntrackt.view",)
|
|
|
"all": ("conntrackt.view",),
|
|
|
}
|
|
|
# Raise authorisation denied exception for unmet permissions.
|
|
|
raise_exception = True
|
|
@@ -108,7 +110,7 @@ class EntityView(MultiplePermissionsRequ
|
|
|
|
|
|
# Required permissions.
|
|
|
permissions = {
|
|
|
"all": ("conntrackt.view",)
|
|
|
"all": ("conntrackt.view",),
|
|
|
}
|
|
|
# Raise authorisation denied exception for unmet permissions.
|
|
|
raise_exception = True
|