# Fixes Permission check order

* fixes bug where permissions would be checked on non-logged in users which caused errors
This commit is contained in:
2025-12-15 09:40:30 +01:00
parent 1af807deae
commit 6aad76866f
9 changed files with 34 additions and 42 deletions

View File

@@ -3,6 +3,8 @@ Author: Michel Peltriaux
Created on: 14.12.25
"""
from abc import ABC
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpRequest, HttpResponse
from django.utils.decorators import method_decorator
@@ -11,15 +13,9 @@ from django.views import View
from konova.decorators import any_group_check
class AbstractIndexView(LoginRequiredMixin, View):
class AbstractIndexView(LoginRequiredMixin, View, ABC):
_TEMPLATE = "generic_index.html"
class Meta:
abstract = True
@method_decorator(any_group_check)
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)
def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
raise NotImplementedError()