X-Git-Url: https://git.mdrn.pl/cas.git/blobdiff_plain/5c901ee485c3abdf11dec71bdb7534f1f6a9eaa9..76fc5b2671d4c445e57236a5b1d54e56fe49764a:/src/services/views.py?ds=inline diff --git a/src/services/views.py b/src/services/views.py index f599592..c2c4a06 100644 --- a/src/services/views.py +++ b/src/services/views.py @@ -1,4 +1,5 @@ -from django.views.generic import DetailView +from django.contrib.auth.mixins import LoginRequiredMixin +from django.views.generic import DetailView, ListView from .models import Service @@ -13,3 +14,12 @@ class SshAuthorizedKeysView(DetailView): obj = None return obj + +class ServicesView(LoginRequiredMixin, ListView): + def get_queryset(self): + return Service.for_user(self.request.user) + + +class ServiceDetail(LoginRequiredMixin, DetailView): + def get_queryset(self): + return Service.for_user(self.request.user)