1 from django.views.generic import DetailView, ListView
2 from .models import Service
5 class SshAuthorizedKeysView(DetailView):
7 template_name = 'services/ssh_authorized_keys.txt'
8 content_type = 'text/plain'
11 obj = super().get_object()
12 if self.request.GET.get('key') != obj.key:
17 class ServicesView(ListView):
18 def get_queryset(self):
19 return Service.for_user(self.request.user)
22 class ServiceDetail(DetailView):
23 def get_queryset(self):
24 return Service.for_user(self.request.user)