diff options
Diffstat (limited to 'ctrack/core/views.py')
-rw-r--r-- | ctrack/core/views.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ctrack/core/views.py b/ctrack/core/views.py index bee2d72..b80d212 100644 --- a/ctrack/core/views.py +++ b/ctrack/core/views.py @@ -1,5 +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): - return render(request, "pages/home.html") + if request.user.is_stakeholder: + 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") |