admin: fix cache clean views erroring
This commit is contained in:
parent
1aecdc7f8f
commit
f265c1f10b
|
@ -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 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 import get_logger
|
from structlog import get_logger
|
||||||
|
@ -20,7 +19,7 @@ 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_admin:overview")
|
success_url = "/"
|
||||||
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:
|
||||||
|
@ -36,7 +35,7 @@ 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_admin:overview")
|
success_url = "/"
|
||||||
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:
|
||||||
|
|
Reference in New Issue