konova/ema/views/action.py
mpeltriaux c7a4c309bf # CompensationAction views refactored
* refactors AbstractCompensationActionViews (new, edit, remove) to inherit from BaseModalFormView
* refactors KOM, OEK, EMA views for compensation actions
* moves message template strings into message_templates.py
2025-10-21 08:48:30 +02:00

36 lines
1.0 KiB
Python

"""
Author: Michel Peltriaux
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
Contact: ksp-servicestelle@sgdnord.rlp.de
Created on: 19.08.22
"""
from ema.models import Ema
from konova.views.action import AbstractNewCompensationActionView, AbstractEditCompensationActionView, \
AbstractRemoveCompensationActionView
_EMA_ACCOUNT_DETAIL_URL_NAME = "ema:detail"
class NewEmaActionView(AbstractNewCompensationActionView):
_MODEL_CLS = Ema
_REDIRECT_URL = _EMA_ACCOUNT_DETAIL_URL_NAME
def _user_has_permission(self, user):
return user.is_ets_user()
class EditEmaActionView(AbstractEditCompensationActionView):
_MODEL_CLS = Ema
_REDIRECT_URL = _EMA_ACCOUNT_DETAIL_URL_NAME
def _user_has_permission(self, user):
return user.is_ets_user()
class RemoveEmaActionView(AbstractRemoveCompensationActionView):
_MODEL_CLS = Ema
_REDIRECT_URL = _EMA_ACCOUNT_DETAIL_URL_NAME
def _user_has_permission(self, user):
return user.is_ets_user()