This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/passbook/admin/views/overview.py

16 lines
556 B
Python
Raw Normal View History

2018-11-11 12:41:48 +00:00
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import TemplateView
from passbook.core.models import Application, Rule, User
class AdministrationOverviewView(LoginRequiredMixin, TemplateView):
template_name = 'administration/overview.html'
def get_context_data(self, **kwargs):
kwargs['application_count'] = len(Application.objects.all())
kwargs['rule_count'] = len(Rule.objects.all())
kwargs['user_count'] = len(User.objects.all())
return super().get_context_data(**kwargs)