1 from django.contrib.auth.mixins import LoginRequiredMixin
2 from django.views.generic import DetailView, ListView
3 from .models import Service
6 class SshAuthorizedKeysView(DetailView):
8 template_name = 'services/ssh_authorized_keys.txt'
9 content_type = 'text/plain'
12 obj = super().get_object()
13 if self.request.GET.get('key') != obj.key:
18 class ServicesView(LoginRequiredMixin, ListView):
19 def get_queryset(self):
20 return Service.for_user(self.request.user)
23 class ServiceDetail(LoginRequiredMixin, DetailView):
24 def get_queryset(self):
25 return Service.for_user(self.request.user)