# Renaming
* renames certain classes to match their content * splits larger files into smaller ones
This commit is contained in:
@@ -15,7 +15,7 @@ from konova.contexts import BaseContext
|
||||
from konova.decorators import default_group_required
|
||||
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
|
||||
from konova.utils.message_templates import NEW_API_TOKEN_GENERATED
|
||||
from konova.views.base import BaseModalFormView
|
||||
from konova.views.modal import AbstractModalFormView
|
||||
from user.forms.modals.api_token import NewAPITokenModalForm
|
||||
from user.models import User
|
||||
|
||||
@@ -38,7 +38,7 @@ class APITokenView(View):
|
||||
context = BaseContext(request, context).context
|
||||
return render(request, template, context)
|
||||
|
||||
class NewAPITokenView(LoginRequiredMixin, BaseModalFormView):
|
||||
class NewAPITokenView(LoginRequiredMixin, AbstractModalFormView):
|
||||
_MODEL_CLS = User
|
||||
_FORM_CLS = NewAPITokenModalForm
|
||||
_MSG_SUCCESS = NEW_API_TOKEN_GENERATED
|
||||
|
||||
@@ -11,14 +11,14 @@ from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from konova.contexts import BaseContext
|
||||
from konova.utils.message_templates import TEAM_LEFT, TEAM_REMOVED, TEAM_EDITED, TEAM_ADDED
|
||||
from konova.views.base import BaseModalFormView
|
||||
from konova.views.modal import AbstractModalFormView
|
||||
from user.forms.modals.team import LeaveTeamModalForm, RemoveTeamModalForm, EditTeamModalForm, NewTeamModalForm
|
||||
from user.forms.team import TeamDataForm
|
||||
from user.models import Team
|
||||
from user.views.users import UserBaseView
|
||||
|
||||
|
||||
class TeamDetailModalView(LoginRequiredMixin, BaseModalFormView):
|
||||
class TeamDetailModalView(LoginRequiredMixin, AbstractModalFormView):
|
||||
_FORM_CLS = TeamDataForm
|
||||
_MODEL_CLS = Team
|
||||
|
||||
@@ -45,7 +45,7 @@ class TeamIndexView(LoginRequiredMixin, UserBaseView):
|
||||
return render(request, self._TEMPLATE, context)
|
||||
|
||||
|
||||
class BaseTeamView(LoginRequiredMixin, BaseModalFormView):
|
||||
class BaseTeamView(LoginRequiredMixin, AbstractModalFormView):
|
||||
_REDIRECT_URL = "user:team-index"
|
||||
_MODEL_CLS = Team
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
|
||||
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
|
||||
from konova.views.base import BaseView, BaseModalFormView
|
||||
from konova.views.modal import AbstractBaseView, AbstractModalFormView
|
||||
from user.forms.modals.user import UserContactForm
|
||||
from user.forms.user import UserNotificationForm
|
||||
from user.models import User
|
||||
@@ -13,7 +13,7 @@ from django.utils.translation import gettext_lazy as _
|
||||
from konova.contexts import BaseContext
|
||||
|
||||
|
||||
class UserBaseView(BaseView):
|
||||
class UserBaseView(AbstractBaseView):
|
||||
def _user_has_shared_access(self, user, **kwargs):
|
||||
return True
|
||||
|
||||
@@ -68,7 +68,7 @@ class NotificationsView(LoginRequiredMixin, UserBaseView):
|
||||
return render(request, self._TEMPLATE, context)
|
||||
|
||||
|
||||
class ContactView(LoginRequiredMixin, BaseModalFormView):
|
||||
class ContactView(LoginRequiredMixin, AbstractModalFormView):
|
||||
_FORM_CLS = UserContactForm
|
||||
_MODEL_CLS = User
|
||||
|
||||
|
||||
Reference in New Issue
Block a user