* refactors team views * split views.py into users.py and teams.py in users app * refactors method headers for _user_has_permission() * adds method and class comments and documentation to base view classes
35 lines
972 B
Python
35 lines
972 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.deadline import AbstractNewDeadlineView, AbstractRemoveDeadlineView, AbstractEditDeadlineView
|
|
|
|
_EMA_DETAIL_URL_NAME = "ema:detail"
|
|
|
|
class NewEmaDeadlineView(AbstractNewDeadlineView):
|
|
_MODEL_CLS = Ema
|
|
_REDIRECT_URL = _EMA_DETAIL_URL_NAME
|
|
|
|
def _user_has_permission(self, user, **kwargs):
|
|
return user.is_ets_user()
|
|
|
|
|
|
class EditEmaDeadlineView(AbstractEditDeadlineView):
|
|
_MODEL_CLS = Ema
|
|
_REDIRECT_URL = _EMA_DETAIL_URL_NAME
|
|
|
|
def _user_has_permission(self, user, **kwargs):
|
|
return user.is_ets_user()
|
|
|
|
|
|
class RemoveEmaDeadlineView(AbstractRemoveDeadlineView):
|
|
_MODEL_CLS = Ema
|
|
_REDIRECT_URL = _EMA_DETAIL_URL_NAME
|
|
|
|
def _user_has_permission(self, user, **kwargs):
|
|
return user.is_ets_user()
|