From ad91abe9de08ff15ddcf5e34d695e24fcad704ad Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 9 Feb 2021 16:17:48 +0100 Subject: [PATCH] admin: remove old sources view --- authentik/admin/urls.py | 1 - authentik/admin/views/sources.py | 27 ++++----------------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/authentik/admin/urls.py b/authentik/admin/urls.py index fb116ccc8..5193cee71 100644 --- a/authentik/admin/urls.py +++ b/authentik/admin/urls.py @@ -61,7 +61,6 @@ urlpatterns = [ name="token-delete", ), # Sources - path("sources/", sources.SourceListView.as_view(), name="sources"), path("sources/create/", sources.SourceCreateView.as_view(), name="source-create"), path( "sources//update/", diff --git a/authentik/admin/views/sources.py b/authentik/admin/views/sources.py index 23fc5d0b9..e8ea57256 100644 --- a/authentik/admin/views/sources.py +++ b/authentik/admin/views/sources.py @@ -6,36 +6,17 @@ from django.contrib.auth.mixins import ( from django.contrib.messages.views import SuccessMessageMixin from django.urls import reverse_lazy from django.utils.translation import gettext as _ -from guardian.mixins import PermissionListMixin, PermissionRequiredMixin +from guardian.mixins import PermissionRequiredMixin from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, InheritanceCreateView, - InheritanceListView, InheritanceUpdateView, - SearchListMixin, - UserPaginateListMixin, ) from authentik.core.models import Source -class SourceListView( - LoginRequiredMixin, - PermissionListMixin, - UserPaginateListMixin, - SearchListMixin, - InheritanceListView, -): - """Show list of all sources""" - - model = Source - permission_required = "authentik_core.view_source" - ordering = "name" - template_name = "administration/source/list.html" - search_fields = ["name", "slug"] - - class SourceCreateView( SuccessMessageMixin, BackSuccessUrlMixin, @@ -49,7 +30,7 @@ class SourceCreateView( permission_required = "authentik_core.add_source" template_name = "generic/create.html" - success_url = reverse_lazy("authentik_admin:sources") + success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully created Source") @@ -66,7 +47,7 @@ class SourceUpdateView( permission_required = "authentik_core.change_source" template_name = "generic/update.html" - success_url = reverse_lazy("authentik_admin:sources") + success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Source") @@ -77,5 +58,5 @@ class SourceDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessag permission_required = "authentik_core.delete_source" template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_admin:sources") + success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully deleted Source")