Files
konova/konova/views/detail.py
mpeltriaux 6aad76866f # Fixes Permission check order
* fixes bug where permissions would be checked on non-logged in users which caused errors
2025-12-15 09:40:30 +01:00

26 lines
714 B
Python

"""
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
from django.views import View
from konova.decorators import uuid_required, any_group_check
class AbstractDetailView(LoginRequiredMixin, View, ABC):
_TEMPLATE = None
@method_decorator(uuid_required)
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)
@method_decorator(any_group_check)
def get(self, request: HttpRequest, id: str, *args, **kwargs) -> HttpResponse:
raise NotImplementedError()