Add behind the scene section on index
This commit is contained in:
parent
7faff5368f
commit
1dfad41e3d
2 changed files with 27 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
# Copyright (C) 2021-2022 Amicale des élèves de l'ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponse
|
||||
from django.views.generic import ListView, View
|
||||
|
|
@ -21,3 +22,13 @@ class IndexView(LoginRequiredMixin, ListView):
|
|||
queryset = Gallery.objects.all()
|
||||
paginate_by = 4
|
||||
template_name = "index.html"
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
# Get superusers
|
||||
User = get_user_model()
|
||||
superusers = User.objects.filter(is_superuser=True)
|
||||
context["superusers"] = superusers
|
||||
|
||||
return context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue