aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/core
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/core')
-rw-r--r--ctrack/core/views.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/ctrack/core/views.py b/ctrack/core/views.py
index 107458e..b80d212 100644
--- a/ctrack/core/views.py
+++ b/ctrack/core/views.py
@@ -1,10 +1,20 @@
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
+from ctrack.organisations.models import Organisation
+
@login_required
def home_page(request):
if request.user.is_stakeholder:
- return render(request, "pages/stakeholder_home.html")
+ org = Organisation.objects.get(
+ name=request.user.stakeholder.person.get_organisation_name()
+ )
+ systems = org.applicablesystem_set.all()
+ return render(
+ request,
+ "pages/stakeholder_home.html",
+ context={"org": org, "systems": systems},
+ )
else:
return render(request, "pages/home.html")