# Fixes Permission check order
* fixes bug where permissions would be checked on non-logged in users which caused errors
This commit is contained in:
@@ -3,7 +3,7 @@ Author: Michel Peltriaux
|
||||
Created on: 14.12.25
|
||||
|
||||
"""
|
||||
from django.http import HttpRequest
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.decorators import method_decorator
|
||||
|
||||
from compensation.models import Compensation
|
||||
@@ -16,5 +16,5 @@ class RemoveCompensationView(AbstractRemoveView):
|
||||
_REDIRECT_URL = "compensation:index"
|
||||
|
||||
@method_decorator(shared_access_required(Compensation, "id"))
|
||||
def dispatch(self, request: HttpRequest, id: str, *args, **kwargs):
|
||||
return super().dispatch(request, id, *args, **kwargs)
|
||||
def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
|
||||
return super().get(request, *args, **kwargs)
|
||||
|
||||
@@ -3,7 +3,7 @@ Author: Michel Peltriaux
|
||||
Created on: 14.12.25
|
||||
|
||||
"""
|
||||
from django.http import HttpRequest
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.utils.decorators import method_decorator
|
||||
|
||||
from compensation.forms.eco_account import RemoveEcoAccountModalForm
|
||||
@@ -18,5 +18,5 @@ class RemoveEcoAccountView(AbstractRemoveView):
|
||||
_FORM = RemoveEcoAccountModalForm
|
||||
|
||||
@method_decorator(shared_access_required(EcoAccount, "id"))
|
||||
def dispatch(self, request: HttpRequest, id: str, *args, **kwargs):
|
||||
return super().dispatch(request, id, *args, **kwargs)
|
||||
def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
|
||||
return super().get(request, *args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user