# Refactoring team views
* 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
This commit is contained in:
@@ -16,14 +16,14 @@ class NewEmaDocumentView(AbstractNewDocumentView):
|
||||
_FORM_CLS = NewEmaDocumentModalForm
|
||||
_REDIRECT_URL = "ema:detail"
|
||||
|
||||
def _user_has_permission(self, user):
|
||||
def _user_has_permission(self, user, **kwargs):
|
||||
return user.is_ets_user()
|
||||
|
||||
class GetEmaDocumentView(AbstractGetDocumentView):
|
||||
_MODEL_CLS = Ema
|
||||
_DOCUMENT_CLS = EmaDocument
|
||||
|
||||
def _user_has_permission(self, user):
|
||||
def _user_has_permission(self, user, **kwargs):
|
||||
return user.is_ets_user()
|
||||
|
||||
class RemoveEmaDocumentView(AbstractRemoveDocumentView):
|
||||
@@ -32,7 +32,7 @@ class RemoveEmaDocumentView(AbstractRemoveDocumentView):
|
||||
_FORM_CLS = RemoveEmaDocumentModalForm
|
||||
_REDIRECT_URL = "ema:detail"
|
||||
|
||||
def _user_has_permission(self, user):
|
||||
def _user_has_permission(self, user, **kwargs):
|
||||
return user.is_ets_user()
|
||||
|
||||
class EditEmaDocumentView(AbstractEditDocumentView):
|
||||
@@ -41,5 +41,5 @@ class EditEmaDocumentView(AbstractEditDocumentView):
|
||||
_DOCUMENT_CLS = EmaDocument
|
||||
_REDIRECT_URL = "ema:detail"
|
||||
|
||||
def _user_has_permission(self, user):
|
||||
def _user_has_permission(self, user, **kwargs):
|
||||
return user.is_ets_user()
|
||||
|
||||
Reference in New Issue
Block a user