diff --git a/authentik/admin/urls.py b/authentik/admin/urls.py index a8527e312..e661165e4 100644 --- a/authentik/admin/urls.py +++ b/authentik/admin/urls.py @@ -20,7 +20,6 @@ from authentik.admin.views import ( stages_bindings, stages_invitations, stages_prompts, - tokens, users, ) from authentik.providers.saml.views.metadata import MetadataImportView @@ -47,17 +46,6 @@ urlpatterns = [ applications.ApplicationUpdateView.as_view(), name="application-update", ), - path( - "applications//delete/", - applications.ApplicationDeleteView.as_view(), - name="application-delete", - ), - # Tokens - path( - "tokens//delete/", - tokens.TokenDeleteView.as_view(), - name="token-delete", - ), # Sources path("sources/create/", sources.SourceCreateView.as_view(), name="source-create"), path( @@ -65,11 +53,6 @@ urlpatterns = [ sources.SourceUpdateView.as_view(), name="source-update", ), - path( - "sources//delete/", - sources.SourceDeleteView.as_view(), - name="source-delete", - ), # Policies path("policies/create/", policies.PolicyCreateView.as_view(), name="policy-create"), path( @@ -77,11 +60,6 @@ urlpatterns = [ policies.PolicyUpdateView.as_view(), name="policy-update", ), - path( - "policies//delete/", - policies.PolicyDeleteView.as_view(), - name="policy-delete", - ), path( "policies//test/", policies.PolicyTestView.as_view(), @@ -98,11 +76,6 @@ urlpatterns = [ policies_bindings.PolicyBindingUpdateView.as_view(), name="policy-binding-update", ), - path( - "policies/bindings//delete/", - policies_bindings.PolicyBindingDeleteView.as_view(), - name="policy-binding-delete", - ), # Providers path( "providers/create/", @@ -119,11 +92,6 @@ urlpatterns = [ providers.ProviderUpdateView.as_view(), name="provider-update", ), - path( - "providers//delete/", - providers.ProviderDeleteView.as_view(), - name="provider-delete", - ), # Stages path("stages/create/", stages.StageCreateView.as_view(), name="stage-create"), path( @@ -131,11 +99,6 @@ urlpatterns = [ stages.StageUpdateView.as_view(), name="stage-update", ), - path( - "stages//delete/", - stages.StageDeleteView.as_view(), - name="stage-delete", - ), # Stage bindings path( "stages/bindings/create/", @@ -147,11 +110,6 @@ urlpatterns = [ stages_bindings.StageBindingUpdateView.as_view(), name="stage-binding-update", ), - path( - "stages/bindings//delete/", - stages_bindings.StageBindingDeleteView.as_view(), - name="stage-binding-delete", - ), # Stage Prompts path( "stages_prompts/create/", @@ -163,22 +121,12 @@ urlpatterns = [ stages_prompts.PromptUpdateView.as_view(), name="stage-prompt-update", ), - path( - "stages_prompts//delete/", - stages_prompts.PromptDeleteView.as_view(), - name="stage-prompt-delete", - ), # Stage Invitations path( "stages/invitations/create/", stages_invitations.InvitationCreateView.as_view(), name="stage-invitation-create", ), - path( - "stages/invitations//delete/", - stages_invitations.InvitationDeleteView.as_view(), - name="stage-invitation-delete", - ), # Flows path( "flows/create/", @@ -205,11 +153,6 @@ urlpatterns = [ flows.FlowExportView.as_view(), name="flow-export", ), - path( - "flows//delete/", - flows.FlowDeleteView.as_view(), - name="flow-delete", - ), # Property Mappings path( "property-mappings/create/", @@ -221,11 +164,6 @@ urlpatterns = [ property_mappings.PropertyMappingUpdateView.as_view(), name="property-mapping-update", ), - path( - "property-mappings//delete/", - property_mappings.PropertyMappingDeleteView.as_view(), - name="property-mapping-delete", - ), path( "property-mappings//test/", property_mappings.PropertyMappingTestView.as_view(), @@ -234,7 +172,6 @@ urlpatterns = [ # Users path("users/create/", users.UserCreateView.as_view(), name="user-create"), path("users//update/", users.UserUpdateView.as_view(), name="user-update"), - path("users//delete/", users.UserDeleteView.as_view(), name="user-delete"), path( "users//disable/", users.UserDisableView.as_view(), name="user-disable" ), @@ -251,11 +188,6 @@ urlpatterns = [ groups.GroupUpdateView.as_view(), name="group-update", ), - path( - "groups//delete/", - groups.GroupDeleteView.as_view(), - name="group-delete", - ), # Certificate-Key Pairs path( "crypto/certificates/create/", @@ -272,11 +204,6 @@ urlpatterns = [ certificate_key_pair.CertificateKeyPairUpdateView.as_view(), name="certificatekeypair-update", ), - path( - "crypto/certificates//delete/", - certificate_key_pair.CertificateKeyPairDeleteView.as_view(), - name="certificatekeypair-delete", - ), # Outposts path( "outposts/create/", @@ -288,11 +215,6 @@ urlpatterns = [ outposts.OutpostUpdateView.as_view(), name="outpost-update", ), - path( - "outposts//delete/", - outposts.OutpostDeleteView.as_view(), - name="outpost-delete", - ), # Outpost Service Connections path( "outpost_service_connections/create/", @@ -304,11 +226,6 @@ urlpatterns = [ outposts_service_connections.OutpostServiceConnectionUpdateView.as_view(), name="outpost-service-connection-update", ), - path( - "outpost_service_connections//delete/", - outposts_service_connections.OutpostServiceConnectionDeleteView.as_view(), - name="outpost-service-connection-delete", - ), # Event Notification Transpots path( "events/transports/create/", @@ -320,11 +237,6 @@ urlpatterns = [ events_notifications_transports.NotificationTransportUpdateView.as_view(), name="notification-transport-update", ), - path( - "events/transports//delete/", - events_notifications_transports.NotificationTransportDeleteView.as_view(), - name="notification-transport-delete", - ), # Event Notification Rules path( "events/rules/create/", @@ -336,9 +248,4 @@ urlpatterns = [ events_notifications_rules.NotificationRuleUpdateView.as_view(), name="notification-rule-update", ), - path( - "events/rules//delete/", - events_notifications_rules.NotificationRuleDeleteView.as_view(), - name="notification-rule-delete", - ), ] diff --git a/authentik/admin/views/applications.py b/authentik/admin/views/applications.py index 37eab8216..450e2e2d9 100644 --- a/authentik/admin/views/applications.py +++ b/authentik/admin/views/applications.py @@ -11,7 +11,6 @@ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin from guardian.shortcuts import get_objects_for_user -from authentik.admin.views.utils import DeleteMessageView from authentik.core.forms.applications import ApplicationForm from authentik.core.models import Application from authentik.lib.views import CreateAssignPermView @@ -65,16 +64,3 @@ class ApplicationUpdateView( success_url = "/" template_name = "generic/update.html" success_message = _("Successfully updated Application") - - -class ApplicationDeleteView( - LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView -): - """Delete application""" - - model = Application - permission_required = "authentik_core.delete_application" - - success_url = "/" - template_name = "generic/delete.html" - success_message = _("Successfully deleted Application") diff --git a/authentik/admin/views/certificate_key_pair.py b/authentik/admin/views/certificate_key_pair.py index 046abd802..9a093cfdc 100644 --- a/authentik/admin/views/certificate_key_pair.py +++ b/authentik/admin/views/certificate_key_pair.py @@ -11,7 +11,6 @@ from django.views.generic import UpdateView from django.views.generic.edit import FormView from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import DeleteMessageView from authentik.crypto.builder import CertificateBuilder from authentik.crypto.forms import ( CertificateKeyPairForm, @@ -80,16 +79,3 @@ class CertificateKeyPairUpdateView( template_name = "generic/update.html" success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Certificate-Key Pair") - - -class CertificateKeyPairDeleteView( - LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView -): - """Delete certificatekeypair""" - - model = CertificateKeyPair - permission_required = "authentik_crypto.delete_certificatekeypair" - - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted Certificate-Key Pair") diff --git a/authentik/admin/views/events_notifications_rules.py b/authentik/admin/views/events_notifications_rules.py index b1caa9df8..48c69fb44 100644 --- a/authentik/admin/views/events_notifications_rules.py +++ b/authentik/admin/views/events_notifications_rules.py @@ -8,7 +8,6 @@ from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import DeleteMessageView from authentik.events.forms import NotificationRuleForm from authentik.events.models import NotificationRule from authentik.lib.views import CreateAssignPermView @@ -46,16 +45,3 @@ class NotificationRuleUpdateView( success_url = "/" template_name = "generic/update.html" success_message = _("Successfully updated Notification Rule") - - -class NotificationRuleDeleteView( - LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView -): - """Delete application""" - - model = NotificationRule - permission_required = "authentik_events.delete_NotificationRule" - - success_url = "/" - template_name = "generic/delete.html" - 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 f13c3340c..14d84ba5a 100644 --- a/authentik/admin/views/events_notifications_transports.py +++ b/authentik/admin/views/events_notifications_transports.py @@ -8,7 +8,6 @@ from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import DeleteMessageView from authentik.events.forms import NotificationTransportForm from authentik.events.models import NotificationTransport from authentik.lib.views import CreateAssignPermView @@ -44,15 +43,3 @@ class NotificationTransportUpdateView( success_url = "/" template_name = "generic/update.html" success_message = _("Successfully updated Notification Transport") - - -class NotificationTransportDeleteView( - LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView -): - """Delete application""" - - model = NotificationTransport - permission_required = "authentik_events.delete_notificationtransport" - success_url = "/" - template_name = "generic/delete.html" - success_message = _("Successfully deleted Notification Transport") diff --git a/authentik/admin/views/flows.py b/authentik/admin/views/flows.py index 25855db33..b6f172b61 100644 --- a/authentik/admin/views/flows.py +++ b/authentik/admin/views/flows.py @@ -11,7 +11,6 @@ from django.utils.translation import gettext as _ from django.views.generic import DetailView, FormView, UpdateView from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import DeleteMessageView from authentik.flows.exceptions import FlowNonApplicableException from authentik.flows.forms import FlowForm, FlowImportForm from authentik.flows.models import Flow @@ -58,17 +57,6 @@ class FlowUpdateView( success_message = _("Successfully updated Flow") -class FlowDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): - """Delete flow""" - - model = Flow - permission_required = "authentik_flows.delete_flow" - - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted Flow") - - class FlowDebugExecuteView(LoginRequiredMixin, PermissionRequiredMixin, DetailView): """Debug exectue flow, setting the current user as pending user""" diff --git a/authentik/admin/views/groups.py b/authentik/admin/views/groups.py index d50bc708f..d50321e44 100644 --- a/authentik/admin/views/groups.py +++ b/authentik/admin/views/groups.py @@ -9,7 +9,6 @@ from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import DeleteMessageView from authentik.core.forms.groups import GroupForm from authentik.core.models import Group from authentik.lib.views import CreateAssignPermView @@ -47,14 +46,3 @@ class GroupUpdateView( template_name = "generic/update.html" success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Group") - - -class GroupDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): - """Delete group""" - - model = Group - permission_required = "authentik_flows.delete_group" - - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted Group") diff --git a/authentik/admin/views/outposts.py b/authentik/admin/views/outposts.py index 17aced477..fa1b93afc 100644 --- a/authentik/admin/views/outposts.py +++ b/authentik/admin/views/outposts.py @@ -11,7 +11,6 @@ from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import DeleteMessageView from authentik.lib.views import CreateAssignPermView from authentik.outposts.forms import OutpostForm from authentik.outposts.models import Outpost, OutpostConfig @@ -54,13 +53,3 @@ class OutpostUpdateView( success_url = "/" template_name = "generic/update.html" success_message = _("Successfully updated Outpost") - - -class OutpostDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): - """Delete outpost""" - - model = Outpost - permission_required = "authentik_outposts.delete_outpost" - success_url = "/" - template_name = "generic/delete.html" - success_message = _("Successfully deleted Outpost") diff --git a/authentik/admin/views/outposts_service_connections.py b/authentik/admin/views/outposts_service_connections.py index e82ffabbd..a69403a1e 100644 --- a/authentik/admin/views/outposts_service_connections.py +++ b/authentik/admin/views/outposts_service_connections.py @@ -8,11 +8,7 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import ( - DeleteMessageView, - InheritanceCreateView, - InheritanceUpdateView, -) +from authentik.admin.views.utils import InheritanceCreateView, InheritanceUpdateView from authentik.outposts.models import OutpostServiceConnection @@ -46,16 +42,3 @@ class OutpostServiceConnectionUpdateView( template_name = "generic/update.html" success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Outpost Service Connection") - - -class OutpostServiceConnectionDeleteView( - LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView -): - """Delete outpostserviceconnection""" - - model = OutpostServiceConnection - permission_required = "authentik_outposts.delete_outpostserviceconnection" - - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted Outpost Service Connection") diff --git a/authentik/admin/views/policies.py b/authentik/admin/views/policies.py index 85a246b0e..027ef2e5b 100644 --- a/authentik/admin/views/policies.py +++ b/authentik/admin/views/policies.py @@ -14,11 +14,7 @@ from django.views.generic.detail import DetailView from guardian.mixins import PermissionRequiredMixin from authentik.admin.forms.policies import PolicyTestForm -from authentik.admin.views.utils import ( - DeleteMessageView, - InheritanceCreateView, - InheritanceUpdateView, -) +from authentik.admin.views.utils import InheritanceCreateView, InheritanceUpdateView from authentik.policies.models import Policy, PolicyBinding from authentik.policies.process import PolicyProcess, PolicyRequest @@ -55,17 +51,6 @@ class PolicyUpdateView( success_message = _("Successfully updated Policy") -class PolicyDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): - """Delete policy""" - - model = Policy - permission_required = "authentik_policies.delete_policy" - - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted Policy") - - class PolicyTestView(LoginRequiredMixin, DetailView, PermissionRequiredMixin, FormView): """View to test policy(s)""" diff --git a/authentik/admin/views/policies_bindings.py b/authentik/admin/views/policies_bindings.py index 2626a0f99..33b96008c 100644 --- a/authentik/admin/views/policies_bindings.py +++ b/authentik/admin/views/policies_bindings.py @@ -12,7 +12,6 @@ from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import DeleteMessageView from authentik.lib.views import CreateAssignPermView from authentik.policies.forms import PolicyBindingForm from authentik.policies.models import PolicyBinding, PolicyBindingModel @@ -66,16 +65,3 @@ class PolicyBindingUpdateView( template_name = "generic/update.html" success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated PolicyBinding") - - -class PolicyBindingDeleteView( - LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView -): - """Delete policybinding""" - - model = PolicyBinding - permission_required = "authentik_policies.delete_policybinding" - - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted PolicyBinding") diff --git a/authentik/admin/views/property_mappings.py b/authentik/admin/views/property_mappings.py index 578b63f91..a276a1a01 100644 --- a/authentik/admin/views/property_mappings.py +++ b/authentik/admin/views/property_mappings.py @@ -14,11 +14,7 @@ from django.views.generic.detail import DetailView from guardian.mixins import PermissionRequiredMixin from authentik.admin.forms.policies import PolicyTestForm -from authentik.admin.views.utils import ( - DeleteMessageView, - InheritanceCreateView, - InheritanceUpdateView, -) +from authentik.admin.views.utils import InheritanceCreateView, InheritanceUpdateView from authentik.core.models import PropertyMapping @@ -52,18 +48,6 @@ class PropertyMappingUpdateView( success_message = _("Successfully updated Property Mapping") -class PropertyMappingDeleteView( - LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView -): - """Delete property_mapping""" - - model = PropertyMapping - permission_required = "authentik_core.delete_propertymapping" - success_url = "/" - template_name = "generic/delete.html" - success_message = _("Successfully deleted Property Mapping") - - class PropertyMappingTestView( LoginRequiredMixin, DetailView, PermissionRequiredMixin, FormView ): diff --git a/authentik/admin/views/providers.py b/authentik/admin/views/providers.py index 3dcc59d59..f4dd2a45f 100644 --- a/authentik/admin/views/providers.py +++ b/authentik/admin/views/providers.py @@ -7,11 +7,7 @@ from django.contrib.messages.views import SuccessMessageMixin from django.utils.translation import gettext as _ from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import ( - DeleteMessageView, - InheritanceCreateView, - InheritanceUpdateView, -) +from authentik.admin.views.utils import InheritanceCreateView, InheritanceUpdateView from authentik.core.models import Provider @@ -43,15 +39,3 @@ class ProviderUpdateView( success_url = "/" template_name = "generic/update.html" success_message = _("Successfully updated Provider") - - -class ProviderDeleteView( - LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView -): - """Delete provider""" - - model = Provider - permission_required = "authentik_core.delete_provider" - success_url = "/" - template_name = "generic/delete.html" - success_message = _("Successfully deleted Provider") diff --git a/authentik/admin/views/sources.py b/authentik/admin/views/sources.py index c9c4fef2b..6191cf61f 100644 --- a/authentik/admin/views/sources.py +++ b/authentik/admin/views/sources.py @@ -7,11 +7,7 @@ from django.contrib.messages.views import SuccessMessageMixin from django.utils.translation import gettext as _ from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import ( - DeleteMessageView, - InheritanceCreateView, - InheritanceUpdateView, -) +from authentik.admin.views.utils import InheritanceCreateView, InheritanceUpdateView from authentik.core.models import Source @@ -45,14 +41,3 @@ class SourceUpdateView( success_url = "/" template_name = "generic/update.html" success_message = _("Successfully updated Source") - - -class SourceDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): - """Delete source""" - - model = Source - permission_required = "authentik_core.delete_source" - - success_url = "/" - template_name = "generic/delete.html" - success_message = _("Successfully deleted Source") diff --git a/authentik/admin/views/stages.py b/authentik/admin/views/stages.py index b63b2fcef..603a2b612 100644 --- a/authentik/admin/views/stages.py +++ b/authentik/admin/views/stages.py @@ -8,11 +8,7 @@ from django.urls import reverse_lazy from django.utils.translation import gettext as _ from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import ( - DeleteMessageView, - InheritanceCreateView, - InheritanceUpdateView, -) +from authentik.admin.views.utils import InheritanceCreateView, InheritanceUpdateView from authentik.flows.models import Stage @@ -45,13 +41,3 @@ class StageUpdateView( template_name = "generic/update.html" success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Stage") - - -class StageDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): - """Delete stage""" - - model = Stage - template_name = "generic/delete.html" - permission_required = "authentik_flows.delete_stage" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted Stage") diff --git a/authentik/admin/views/stages_bindings.py b/authentik/admin/views/stages_bindings.py index b1038eb1f..5621bf01e 100644 --- a/authentik/admin/views/stages_bindings.py +++ b/authentik/admin/views/stages_bindings.py @@ -12,7 +12,6 @@ from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import DeleteMessageView from authentik.flows.forms import FlowStageBindingForm from authentik.flows.models import Flow, FlowStageBinding from authentik.lib.views import CreateAssignPermView @@ -64,16 +63,3 @@ class StageBindingUpdateView( template_name = "generic/update.html" success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated StageBinding") - - -class StageBindingDeleteView( - LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView -): - """Delete FlowStageBinding""" - - model = FlowStageBinding - permission_required = "authentik_flows.delete_flowstagebinding" - - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted FlowStageBinding") diff --git a/authentik/admin/views/stages_invitations.py b/authentik/admin/views/stages_invitations.py index f792c875d..afbcfee13 100644 --- a/authentik/admin/views/stages_invitations.py +++ b/authentik/admin/views/stages_invitations.py @@ -7,9 +7,7 @@ from django.contrib.messages.views import SuccessMessageMixin from django.http import HttpResponseRedirect from django.urls import reverse_lazy from django.utils.translation import gettext as _ -from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import DeleteMessageView from authentik.lib.views import CreateAssignPermView from authentik.stages.invitation.forms import InvitationForm from authentik.stages.invitation.models import Invitation @@ -36,16 +34,3 @@ class InvitationCreateView( obj.created_by = self.request.user obj.save() return HttpResponseRedirect(self.success_url) - - -class InvitationDeleteView( - LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView -): - """Delete invitation""" - - model = Invitation - permission_required = "authentik_stages_invitation.delete_invitation" - - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted Invitation") diff --git a/authentik/admin/views/stages_prompts.py b/authentik/admin/views/stages_prompts.py index a9ab27668..8ef5feb1f 100644 --- a/authentik/admin/views/stages_prompts.py +++ b/authentik/admin/views/stages_prompts.py @@ -9,7 +9,6 @@ from django.utils.translation import gettext as _ from django.views.generic import UpdateView from guardian.mixins import PermissionRequiredMixin -from authentik.admin.views.utils import DeleteMessageView from authentik.lib.views import CreateAssignPermView from authentik.stages.prompt.forms import PromptAdminForm from authentik.stages.prompt.models import Prompt @@ -47,14 +46,3 @@ class PromptUpdateView( template_name = "generic/update.html" success_url = reverse_lazy("authentik_core:shell") success_message = _("Successfully updated Prompt") - - -class PromptDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): - """Delete prompt""" - - model = Prompt - permission_required = "authentik_stages_prompt.delete_prompt" - - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted Prompt") diff --git a/authentik/admin/views/tokens.py b/authentik/admin/views/tokens.py deleted file mode 100644 index 966189227..000000000 --- a/authentik/admin/views/tokens.py +++ /dev/null @@ -1,19 +0,0 @@ -"""authentik Token administration""" -from django.contrib.auth.mixins import LoginRequiredMixin -from django.urls import reverse_lazy -from django.utils.translation import gettext as _ -from guardian.mixins import PermissionRequiredMixin - -from authentik.admin.views.utils import DeleteMessageView -from authentik.core.models import Token - - -class TokenDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): - """Delete token""" - - model = Token - permission_required = "authentik_core.delete_token" - - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted Token") diff --git a/authentik/admin/views/users.py b/authentik/admin/views/users.py index 0708f9038..541842b79 100644 --- a/authentik/admin/views/users.py +++ b/authentik/admin/views/users.py @@ -56,19 +56,6 @@ class UserUpdateView( success_message = _("Successfully updated User") -class UserDeleteView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): - """Delete user""" - - model = User - permission_required = "authentik_core.delete_user" - - # By default the object's name is user which is used by other checks - context_object_name = "object" - template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_core:shell") - success_message = _("Successfully deleted User") - - class UserDisableView(LoginRequiredMixin, PermissionRequiredMixin, DeleteMessageView): """Disable user"""