# Share view refactoring

* refactors share views for eiv, oek, ema (kom does not have any)
This commit is contained in:
2025-10-21 19:15:17 +02:00
parent 3de97e2f6a
commit 00bf03f58d
4 changed files with 35 additions and 83 deletions

View File

@@ -5,29 +5,15 @@ Contact: ksp-servicestelle@sgdnord.rlp.de
Created on: 19.08.22
"""
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from intervention.models import Intervention
from konova.decorators import default_group_required, shared_access_required, login_required_modal
from konova.views.share import AbstractShareByTokenView, AbstractShareFormView
class InterventionShareByTokenView(AbstractShareByTokenView):
model = Intervention
redirect_url = "intervention:detail"
@method_decorator(login_required)
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)
_MODEL_CLS = Intervention
_REDIRECT_URL = "intervention:detail"
class InterventionShareFormView(AbstractShareFormView):
model = Intervention
@method_decorator(login_required_modal)
@method_decorator(login_required)
@method_decorator(default_group_required)
@method_decorator(shared_access_required(Intervention, "id"))
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)
_MODEL_CLS = Intervention
_REDIRECT_URL = "intervention:detail"