# Index views

* refactors index view methods into classes
* introduces AbstractIndexView as base class
This commit is contained in:
2025-12-14 16:00:40 +01:00
parent 4c4d64cc3d
commit fdf3adf5ae
9 changed files with 140 additions and 124 deletions

23
konova/views/index.py Normal file
View File

@@ -0,0 +1,23 @@
"""
Author: Michel Peltriaux
Created on: 14.12.25
"""
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.decorators import method_decorator
from django.views import View
from konova.decorators import any_group_check
class AbstractIndexView(LoginRequiredMixin, View):
_TEMPLATE = "generic_index.html"
class Meta:
abstract = True
@method_decorator(login_required)
@method_decorator(any_group_check)
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)