Fix session detail page for collaborators (fixes #74)

This commit is contained in:
R. Miles McCain 2020-08-18 15:41:50 +00:00
parent 6652acdf14
commit 03062e3de5
No known key found for this signature in database
GPG Key ID: F1053629E2905557

View File

@ -139,6 +139,9 @@ class ServiceSessionView(LoginRequiredMixin, PermissionRequiredMixin, DetailView
context_object_name = "session"
permission_required = "core.view_service"
def get_permission_object(self, **kwargs):
return self.get_object().service
def get_context_data(self, **kwargs):
data = super().get_context_data(**kwargs)
data["object"] = get_object_or_404(Service, pk=self.kwargs.get("pk"))