* fixes bug where permissions would be checked on non-logged in users which caused errors
23 lines
724 B
Python
23 lines
724 B
Python
"""
|
|
Author: Michel Peltriaux
|
|
Created on: 14.12.25
|
|
|
|
"""
|
|
from django.http import HttpRequest, HttpResponse
|
|
from django.utils.decorators import method_decorator
|
|
|
|
from compensation.forms.eco_account import RemoveEcoAccountModalForm
|
|
from compensation.models import EcoAccount
|
|
from konova.decorators import shared_access_required
|
|
from konova.views.remove import AbstractRemoveView
|
|
|
|
|
|
class RemoveEcoAccountView(AbstractRemoveView):
|
|
_MODEL = EcoAccount
|
|
_REDIRECT_URL = "compensation:acc:index"
|
|
_FORM = RemoveEcoAccountModalForm
|
|
|
|
@method_decorator(shared_access_required(EcoAccount, "id"))
|
|
def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
|
|
return super().get(request, *args, **kwargs)
|