admin: remove unnecessary success_urls

This commit is contained in:
Jens Langhammer 2021-02-09 20:58:46 +01:00
parent a7d0a50859
commit 2d4e7ebab5
8 changed files with 0 additions and 31 deletions

View file

@ -4,7 +4,6 @@ from django.contrib.auth.mixins import (
PermissionRequiredMixin as DjangoPermissionRequiredMixin, PermissionRequiredMixin as DjangoPermissionRequiredMixin,
) )
from django.contrib.messages.views import SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse_lazy
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from django.views.generic import UpdateView from django.views.generic import UpdateView
from guardian.mixins import PermissionRequiredMixin from guardian.mixins import PermissionRequiredMixin
@ -29,7 +28,6 @@ class ApplicationCreateView(
permission_required = "authentik_core.add_application" permission_required = "authentik_core.add_application"
template_name = "generic/create.html" template_name = "generic/create.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully created Application") success_message = _("Successfully created Application")
@ -47,7 +45,6 @@ class ApplicationUpdateView(
permission_required = "authentik_core.change_application" permission_required = "authentik_core.change_application"
template_name = "generic/update.html" template_name = "generic/update.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully updated Application") success_message = _("Successfully updated Application")
@ -60,5 +57,4 @@ class ApplicationDeleteView(
permission_required = "authentik_core.delete_application" permission_required = "authentik_core.delete_application"
template_name = "generic/delete.html" template_name = "generic/delete.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully deleted Application") success_message = _("Successfully deleted Application")

View file

@ -4,7 +4,6 @@ from django.contrib.auth.mixins import (
PermissionRequiredMixin as DjangoPermissionRequiredMixin, PermissionRequiredMixin as DjangoPermissionRequiredMixin,
) )
from django.contrib.messages.views import SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse_lazy
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from django.views.generic import UpdateView from django.views.generic import UpdateView
from guardian.mixins import PermissionRequiredMixin from guardian.mixins import PermissionRequiredMixin
@ -29,7 +28,6 @@ class NotificationRuleCreateView(
permission_required = "authentik_events.add_NotificationRule" permission_required = "authentik_events.add_NotificationRule"
template_name = "generic/create.html" template_name = "generic/create.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully created Notification Rule") success_message = _("Successfully created Notification Rule")
@ -47,7 +45,6 @@ class NotificationRuleUpdateView(
permission_required = "authentik_events.change_NotificationRule" permission_required = "authentik_events.change_NotificationRule"
template_name = "generic/update.html" template_name = "generic/update.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully updated Notification Rule") success_message = _("Successfully updated Notification Rule")
@ -60,5 +57,4 @@ class NotificationRuleDeleteView(
permission_required = "authentik_events.delete_NotificationRule" permission_required = "authentik_events.delete_NotificationRule"
template_name = "generic/delete.html" template_name = "generic/delete.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully deleted Notification Rule") success_message = _("Successfully deleted Notification Rule")

View file

@ -4,7 +4,6 @@ from django.contrib.auth.mixins import (
PermissionRequiredMixin as DjangoPermissionRequiredMixin, PermissionRequiredMixin as DjangoPermissionRequiredMixin,
) )
from django.contrib.messages.views import SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse_lazy
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from django.views.generic import UpdateView from django.views.generic import UpdateView
from guardian.mixins import PermissionRequiredMixin from guardian.mixins import PermissionRequiredMixin
@ -29,7 +28,6 @@ class NotificationTransportCreateView(
permission_required = "authentik_events.add_notificationtransport" permission_required = "authentik_events.add_notificationtransport"
template_name = "generic/create.html" template_name = "generic/create.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully created Notification Transport") success_message = _("Successfully created Notification Transport")
@ -47,7 +45,6 @@ class NotificationTransportUpdateView(
permission_required = "authentik_events.change_notificationtransport" permission_required = "authentik_events.change_notificationtransport"
template_name = "generic/update.html" template_name = "generic/update.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully updated Notification Transport") success_message = _("Successfully updated Notification Transport")
@ -60,5 +57,4 @@ class NotificationTransportDeleteView(
permission_required = "authentik_events.delete_notificationtransport" permission_required = "authentik_events.delete_notificationtransport"
template_name = "generic/delete.html" template_name = "generic/delete.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully deleted Notification Transport") success_message = _("Successfully deleted Notification Transport")

View file

@ -7,7 +7,6 @@ from django.contrib.auth.mixins import (
PermissionRequiredMixin as DjangoPermissionRequiredMixin, PermissionRequiredMixin as DjangoPermissionRequiredMixin,
) )
from django.contrib.messages.views import SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse_lazy
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from django.views.generic import UpdateView from django.views.generic import UpdateView
from guardian.mixins import PermissionRequiredMixin from guardian.mixins import PermissionRequiredMixin
@ -32,7 +31,6 @@ class OutpostCreateView(
permission_required = "authentik_outposts.add_outpost" permission_required = "authentik_outposts.add_outpost"
template_name = "generic/create.html" template_name = "generic/create.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully created Outpost") success_message = _("Successfully created Outpost")
def get_initial(self) -> Dict[str, Any]: def get_initial(self) -> Dict[str, Any]:
@ -57,7 +55,6 @@ class OutpostUpdateView(
permission_required = "authentik_outposts.change_outpost" permission_required = "authentik_outposts.change_outpost"
template_name = "generic/update.html" template_name = "generic/update.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully updated Outpost") success_message = _("Successfully updated Outpost")
@ -68,5 +65,4 @@ class OutpostDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessa
permission_required = "authentik_outposts.delete_outpost" permission_required = "authentik_outposts.delete_outpost"
template_name = "generic/delete.html" template_name = "generic/delete.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully deleted Outpost") success_message = _("Successfully deleted Outpost")

View file

@ -3,7 +3,6 @@ from django.contrib.messages.views import SuccessMessageMixin
from django.core.cache import cache from django.core.cache import cache
from django.http.request import HttpRequest from django.http.request import HttpRequest
from django.http.response import HttpResponse from django.http.response import HttpResponse
from django.urls.base import reverse_lazy
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from django.views.generic import FormView from django.views.generic import FormView
from structlog.stdlib import get_logger from structlog.stdlib import get_logger
@ -21,7 +20,6 @@ class PolicyCacheClearView(AdminRequiredMixin, SuccessMessageMixin, FormView):
form_class = PolicyCacheClearForm form_class = PolicyCacheClearForm
template_name = "generic/form_non_model.html" template_name = "generic/form_non_model.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully cleared Policy cache") success_message = _("Successfully cleared Policy cache")
def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
@ -40,7 +38,6 @@ class FlowCacheClearView(AdminRequiredMixin, SuccessMessageMixin, FormView):
form_class = FlowCacheClearForm form_class = FlowCacheClearForm
template_name = "generic/form_non_model.html" template_name = "generic/form_non_model.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully cleared Flow cache") success_message = _("Successfully cleared Flow cache")
def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:

View file

@ -8,7 +8,6 @@ from django.contrib.auth.mixins import (
) )
from django.contrib.messages.views import SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin
from django.http import HttpResponse from django.http import HttpResponse
from django.urls import reverse_lazy
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from django.views.generic import FormView from django.views.generic import FormView
from django.views.generic.detail import DetailView from django.views.generic.detail import DetailView
@ -37,7 +36,6 @@ class PropertyMappingCreateView(
permission_required = "authentik_core.add_propertymapping" permission_required = "authentik_core.add_propertymapping"
template_name = "generic/create.html" template_name = "generic/create.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully created Property Mapping") success_message = _("Successfully created Property Mapping")
@ -54,7 +52,6 @@ class PropertyMappingUpdateView(
permission_required = "authentik_core.change_propertymapping" permission_required = "authentik_core.change_propertymapping"
template_name = "generic/update.html" template_name = "generic/update.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully updated Property Mapping") success_message = _("Successfully updated Property Mapping")
@ -67,7 +64,6 @@ class PropertyMappingDeleteView(
permission_required = "authentik_core.delete_propertymapping" permission_required = "authentik_core.delete_propertymapping"
template_name = "generic/delete.html" template_name = "generic/delete.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully deleted Property Mapping") success_message = _("Successfully deleted Property Mapping")

View file

@ -4,7 +4,6 @@ from django.contrib.auth.mixins import (
PermissionRequiredMixin as DjangoPermissionRequiredMixin, PermissionRequiredMixin as DjangoPermissionRequiredMixin,
) )
from django.contrib.messages.views import SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse_lazy
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from guardian.mixins import PermissionRequiredMixin from guardian.mixins import PermissionRequiredMixin
@ -30,7 +29,6 @@ class ProviderCreateView(
permission_required = "authentik_core.add_provider" permission_required = "authentik_core.add_provider"
template_name = "generic/create.html" template_name = "generic/create.html"
success_url = reverse_lazy("authentik_admin:providers")
success_message = _("Successfully created Provider") success_message = _("Successfully created Provider")
@ -47,7 +45,6 @@ class ProviderUpdateView(
permission_required = "authentik_core.change_provider" permission_required = "authentik_core.change_provider"
template_name = "generic/update.html" template_name = "generic/update.html"
success_url = reverse_lazy("authentik_admin:providers")
success_message = _("Successfully updated Provider") success_message = _("Successfully updated Provider")
@ -60,5 +57,4 @@ class ProviderDeleteView(
permission_required = "authentik_core.delete_provider" permission_required = "authentik_core.delete_provider"
template_name = "generic/delete.html" template_name = "generic/delete.html"
success_url = reverse_lazy("authentik_admin:providers")
success_message = _("Successfully deleted Provider") success_message = _("Successfully deleted Provider")

View file

@ -4,7 +4,6 @@ from django.contrib.auth.mixins import (
PermissionRequiredMixin as DjangoPermissionRequiredMixin, PermissionRequiredMixin as DjangoPermissionRequiredMixin,
) )
from django.contrib.messages.views import SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse_lazy
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from guardian.mixins import PermissionRequiredMixin from guardian.mixins import PermissionRequiredMixin
@ -30,7 +29,6 @@ class SourceCreateView(
permission_required = "authentik_core.add_source" permission_required = "authentik_core.add_source"
template_name = "generic/create.html" template_name = "generic/create.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully created Source") success_message = _("Successfully created Source")
@ -47,7 +45,6 @@ class SourceUpdateView(
permission_required = "authentik_core.change_source" permission_required = "authentik_core.change_source"
template_name = "generic/update.html" template_name = "generic/update.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully updated Source") success_message = _("Successfully updated Source")
@ -58,5 +55,4 @@ class SourceDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessag
permission_required = "authentik_core.delete_source" permission_required = "authentik_core.delete_source"
template_name = "generic/delete.html" template_name = "generic/delete.html"
success_url = reverse_lazy("authentik_core:shell")
success_message = _("Successfully deleted Source") success_message = _("Successfully deleted Source")