* refactors compensation state views for kom, ema, oek * updates tests * refactors before-after state toggling into initialization of NewCompensationStateModalForm
35 lines
930 B
Python
35 lines
930 B
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.state import AbstractNewCompensationStateView, AbstractEditCompensationStateView, \
|
|
AbstractRemoveCompensationStateView
|
|
|
|
|
|
class NewEmaStateView(AbstractNewCompensationStateView):
|
|
_MODEL_CLS = Ema
|
|
_REDIRECT_URL = "ema:detail"
|
|
|
|
def _user_has_permission(self, user):
|
|
return user.is_ets_user()
|
|
|
|
|
|
class EditEmaStateView(AbstractEditCompensationStateView):
|
|
_MODEL_CLS = Ema
|
|
_REDIRECT_URL = "ema:detail"
|
|
|
|
def _user_has_permission(self, user):
|
|
return user.is_ets_user()
|
|
|
|
|
|
class RemoveEmaStateView(AbstractRemoveCompensationStateView):
|
|
_MODEL_CLS = Ema
|
|
_REDIRECT_URL = "ema:detail"
|
|
|
|
def _user_has_permission(self, user):
|
|
return user.is_ets_user()
|