From 2d4e7ebab597973e6e9dd513ee00e00bbea3c6a9 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 9 Feb 2021 20:58:46 +0100 Subject: [PATCH] admin: remove unnecessary success_urls --- authentik/admin/views/applications.py | 4 ---- authentik/admin/views/events_notifications_rules.py | 4 ---- authentik/admin/views/events_notifications_transports.py | 4 ---- authentik/admin/views/outposts.py | 4 ---- authentik/admin/views/overview.py | 3 --- authentik/admin/views/property_mappings.py | 4 ---- authentik/admin/views/providers.py | 4 ---- authentik/admin/views/sources.py | 4 ---- 8 files changed, 31 deletions(-) diff --git a/authentik/admin/views/applications.py b/authentik/admin/views/applications.py index 1f294af8f..abaaa4292 100644 --- a/authentik/admin/views/applications.py +++ b/authentik/admin/views/applications.py @@ -4,7 +4,6 @@ from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, ) from django.contrib.messages.views import SuccessMessageMixin -from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin @@ -29,7 +28,6 @@ class ApplicationCreateView( permission_required = "authentik_core.add_application" template_name = "generic/create.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully created Application") @@ -47,7 +45,6 @@ class ApplicationUpdateView( permission_required = "authentik_core.change_application" template_name = "generic/update.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Application") @@ -60,5 +57,4 @@ class ApplicationDeleteView( permission_required = "authentik_core.delete_application" template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully deleted Application") diff --git a/authentik/admin/views/events_notifications_rules.py b/authentik/admin/views/events_notifications_rules.py index cf7b70a73..7cb2fc390 100644 --- a/authentik/admin/views/events_notifications_rules.py +++ b/authentik/admin/views/events_notifications_rules.py @@ -4,7 +4,6 @@ from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, ) from django.contrib.messages.views import SuccessMessageMixin -from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin @@ -29,7 +28,6 @@ class NotificationRuleCreateView( permission_required = "authentik_events.add_NotificationRule" template_name = "generic/create.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully created Notification Rule") @@ -47,7 +45,6 @@ class NotificationRuleUpdateView( permission_required = "authentik_events.change_NotificationRule" template_name = "generic/update.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Notification Rule") @@ -60,5 +57,4 @@ class NotificationRuleDeleteView( permission_required = "authentik_events.delete_NotificationRule" template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully deleted Notification Rule") diff --git a/authentik/admin/views/events_notifications_transports.py b/authentik/admin/views/events_notifications_transports.py index ecc0a172f..d211831ed 100644 --- a/authentik/admin/views/events_notifications_transports.py +++ b/authentik/admin/views/events_notifications_transports.py @@ -4,7 +4,6 @@ from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, ) from django.contrib.messages.views import SuccessMessageMixin -from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin @@ -29,7 +28,6 @@ class NotificationTransportCreateView( permission_required = "authentik_events.add_notificationtransport" template_name = "generic/create.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully created Notification Transport") @@ -47,7 +45,6 @@ class NotificationTransportUpdateView( permission_required = "authentik_events.change_notificationtransport" template_name = "generic/update.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Notification Transport") @@ -60,5 +57,4 @@ class NotificationTransportDeleteView( permission_required = "authentik_events.delete_notificationtransport" template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully deleted Notification Transport") diff --git a/authentik/admin/views/outposts.py b/authentik/admin/views/outposts.py index c9772ce8b..fb9eee561 100644 --- a/authentik/admin/views/outposts.py +++ b/authentik/admin/views/outposts.py @@ -7,7 +7,6 @@ from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, ) from django.contrib.messages.views import SuccessMessageMixin -from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin @@ -32,7 +31,6 @@ class OutpostCreateView( permission_required = "authentik_outposts.add_outpost" template_name = "generic/create.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully created Outpost") def get_initial(self) -> Dict[str, Any]: @@ -57,7 +55,6 @@ class OutpostUpdateView( permission_required = "authentik_outposts.change_outpost" template_name = "generic/update.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Outpost") @@ -68,5 +65,4 @@ class OutpostDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessa permission_required = "authentik_outposts.delete_outpost" template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully deleted Outpost") diff --git a/authentik/admin/views/overview.py b/authentik/admin/views/overview.py index c188c039b..cc6d42f9c 100644 --- a/authentik/admin/views/overview.py +++ b/authentik/admin/views/overview.py @@ -3,7 +3,6 @@ from django.contrib.messages.views import SuccessMessageMixin from django.core.cache import cache from django.http.request import HttpRequest from django.http.response import HttpResponse -from django.urls.base import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic import FormView from structlog.stdlib import get_logger @@ -21,7 +20,6 @@ class PolicyCacheClearView(AdminRequiredMixin, SuccessMessageMixin, FormView): form_class = PolicyCacheClearForm template_name = "generic/form_non_model.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully cleared Policy cache") def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: @@ -40,7 +38,6 @@ class FlowCacheClearView(AdminRequiredMixin, SuccessMessageMixin, FormView): form_class = FlowCacheClearForm template_name = "generic/form_non_model.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully cleared Flow cache") def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse: diff --git a/authentik/admin/views/property_mappings.py b/authentik/admin/views/property_mappings.py index ff87583e9..ca6b2796f 100644 --- a/authentik/admin/views/property_mappings.py +++ b/authentik/admin/views/property_mappings.py @@ -8,7 +8,6 @@ from django.contrib.auth.mixins import ( ) from django.contrib.messages.views import SuccessMessageMixin from django.http import HttpResponse -from django.urls import reverse_lazy from django.utils.translation import gettext as _ from django.views.generic import FormView from django.views.generic.detail import DetailView @@ -37,7 +36,6 @@ class PropertyMappingCreateView( permission_required = "authentik_core.add_propertymapping" template_name = "generic/create.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully created Property Mapping") @@ -54,7 +52,6 @@ class PropertyMappingUpdateView( permission_required = "authentik_core.change_propertymapping" template_name = "generic/update.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Property Mapping") @@ -67,7 +64,6 @@ class PropertyMappingDeleteView( permission_required = "authentik_core.delete_propertymapping" template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully deleted Property Mapping") diff --git a/authentik/admin/views/providers.py b/authentik/admin/views/providers.py index c94b0dfb0..76eefa839 100644 --- a/authentik/admin/views/providers.py +++ b/authentik/admin/views/providers.py @@ -4,7 +4,6 @@ from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, ) from django.contrib.messages.views import SuccessMessageMixin -from django.urls import reverse_lazy from django.utils.translation import gettext as _ from guardian.mixins import PermissionRequiredMixin @@ -30,7 +29,6 @@ class ProviderCreateView( permission_required = "authentik_core.add_provider" template_name = "generic/create.html" - success_url = reverse_lazy("authentik_admin:providers") success_message = _("Successfully created Provider") @@ -47,7 +45,6 @@ class ProviderUpdateView( permission_required = "authentik_core.change_provider" template_name = "generic/update.html" - success_url = reverse_lazy("authentik_admin:providers") success_message = _("Successfully updated Provider") @@ -60,5 +57,4 @@ class ProviderDeleteView( permission_required = "authentik_core.delete_provider" template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_admin:providers") success_message = _("Successfully deleted Provider") diff --git a/authentik/admin/views/sources.py b/authentik/admin/views/sources.py index e8ea57256..7ebe243b8 100644 --- a/authentik/admin/views/sources.py +++ b/authentik/admin/views/sources.py @@ -4,7 +4,6 @@ from django.contrib.auth.mixins import ( PermissionRequiredMixin as DjangoPermissionRequiredMixin, ) from django.contrib.messages.views import SuccessMessageMixin -from django.urls import reverse_lazy from django.utils.translation import gettext as _ from guardian.mixins import PermissionRequiredMixin @@ -30,7 +29,6 @@ class SourceCreateView( permission_required = "authentik_core.add_source" template_name = "generic/create.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully created Source") @@ -47,7 +45,6 @@ class SourceUpdateView( permission_required = "authentik_core.change_source" template_name = "generic/update.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Source") @@ -58,5 +55,4 @@ class SourceDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessag permission_required = "authentik_core.delete_source" template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully deleted Source")