# Intervention remove compensation
* adds default role check for intervention's compensation removing endpoint
This commit is contained in:
@@ -14,7 +14,7 @@ from django.utils.decorators import method_decorator
|
||||
from django.views import View
|
||||
|
||||
from intervention.models import Intervention
|
||||
from konova.decorators import shared_access_required
|
||||
from konova.decorators import shared_access_required, default_group_required
|
||||
from konova.forms.modals import RemoveModalForm
|
||||
from konova.utils.message_templates import COMPENSATION_REMOVED_TEMPLATE
|
||||
|
||||
@@ -45,10 +45,12 @@ class RemoveCompensationFromInterventionView(LoginRequiredMixin, View):
|
||||
redirect_url=reverse("intervention:detail", args=(id,)) + "#related_data",
|
||||
)
|
||||
|
||||
@method_decorator(default_group_required)
|
||||
@method_decorator(shared_access_required(Intervention, "id"))
|
||||
def get(self, request, id: str, comp_id: str, *args, **kwargs) -> HttpResponse:
|
||||
return self.__process_request(request, id, comp_id, *args, **kwargs)
|
||||
|
||||
@method_decorator(default_group_required)
|
||||
@method_decorator(shared_access_required(Intervention, "id"))
|
||||
def post(self, request, id: str, comp_id: str, *args, **kwargs) -> HttpResponse:
|
||||
return self.__process_request(request, id, comp_id, *args, **kwargs)
|
||||
Reference in New Issue
Block a user