diff --git a/authentik/admin/templates/administration/stage_binding/list.html b/authentik/admin/templates/administration/stage_binding/list.html deleted file mode 100644 index c4a772a62..000000000 --- a/authentik/admin/templates/administration/stage_binding/list.html +++ /dev/null @@ -1,125 +0,0 @@ -{% extends "administration/base.html" %} - -{% load i18n %} -{% load authentik_utils %} - -{% block content %} -
-
-

- - {% trans 'Stage Bindings' %} -

-

{% trans "Bind existing Stages to Flows." %}

-
-
-
-
- {% if object_list %} -
-
-
- - - {% trans 'Create' %} - -
-
- -
- {% include 'partials/pagination.html' %} -
-
- - - - - - - - - - - {% regroup object_list by target as grouped_bindings %} - {% for flow in grouped_bindings %} - - - - - - - {% for binding in flow.list %} - - - - - - - {% endfor %} - {% endfor %} - -
{% trans 'Order' %}{% trans 'Name' %}{% trans 'Stage Type' %}
- {% blocktrans with slug=flow.grouper.slug %} - Flow {{ slug }} - {% endblocktrans %} -
- - {{ binding.order }} - - -
-
{{ binding.target.slug }}
- - {{ binding.target.name }} - -
-
-
-
- {{ binding.stage.name }} -
- - {{ binding.stage }} - -
-
- - - {% trans 'Update' %} - -
-
- - - {% trans 'Delete' %} - -
-
-
-
- {% include 'partials/pagination.html' %} -
- {% else %} -
-
- -

- {% trans 'No Flow-Stage Bindings.' %} -

-
- {% trans 'Currently no flow-stage bindings exist. Click the button below to create one.' %} -
- - - {% trans 'Create' %} - -
-
-
-
- {% endif %} -
-
-{% endblock %} diff --git a/authentik/admin/urls.py b/authentik/admin/urls.py index d2deda6e9..b68496059 100644 --- a/authentik/admin/urls.py +++ b/authentik/admin/urls.py @@ -145,11 +145,6 @@ urlpatterns = [ name="stage-delete", ), # Stage bindings - path( - "stages/bindings/", - stages_bindings.StageBindingListView.as_view(), - name="stage-bindings", - ), path( "stages/bindings/create/", stages_bindings.StageBindingCreateView.as_view(), diff --git a/authentik/admin/views/stages_bindings.py b/authentik/admin/views/stages_bindings.py index 7e416d19f..ef7e0daef 100644 --- a/authentik/admin/views/stages_bindings.py +++ b/authentik/admin/views/stages_bindings.py @@ -7,32 +7,19 @@ from django.contrib.auth.mixins import ( ) from django.contrib.messages.views import SuccessMessageMixin from django.db.models import Max -from django.urls import reverse_lazy from django.utils.translation import gettext as _ -from django.views.generic import ListView, UpdateView -from guardian.mixins import PermissionListMixin, PermissionRequiredMixin +from django.views.generic import UpdateView +from guardian.mixins import PermissionRequiredMixin from authentik.admin.views.utils import ( BackSuccessUrlMixin, DeleteMessageView, - UserPaginateListMixin, ) from authentik.flows.forms import FlowStageBindingForm from authentik.flows.models import Flow, FlowStageBinding from authentik.lib.views import CreateAssignPermView -class StageBindingListView( - LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, ListView -): - """Show list of all flows""" - - model = FlowStageBinding - permission_required = "authentik_flows.view_flowstagebinding" - ordering = ["target", "order"] - template_name = "administration/stage_binding/list.html" - - class StageBindingCreateView( SuccessMessageMixin, BackSuccessUrlMixin, @@ -47,7 +34,7 @@ class StageBindingCreateView( form_class = FlowStageBindingForm template_name = "generic/create.html" - success_url = reverse_lazy("authentik_admin:stage-bindings") + success_url = "/" success_message = _("Successfully created StageBinding") def get_initial(self) -> dict[str, Any]: @@ -79,7 +66,7 @@ class StageBindingUpdateView( form_class = FlowStageBindingForm template_name = "generic/update.html" - success_url = reverse_lazy("authentik_admin:stage-bindings") + success_url = "/" success_message = _("Successfully updated StageBinding") @@ -92,5 +79,5 @@ class StageBindingDeleteView( permission_required = "authentik_flows.delete_flowstagebinding" template_name = "generic/delete.html" - success_url = reverse_lazy("authentik_admin:stage-bindings") + success_url = "/" success_message = _("Successfully deleted FlowStageBinding")