admin: add BackSuccessUrlMixin to redirect to correct url after form edit

This commit is contained in:
Jens Langhammer
2020-09-26 01:56:28 +02:00
parent e104c74761
commit 899c5b63ea
17 changed files with 196 additions and 41 deletions

View File

@ -9,15 +9,19 @@ from django.utils.translation import gettext as _
from guardian.mixins import PermissionListMixin, PermissionRequiredMixin
from passbook.admin.views.utils import (
BackSuccessUrlMixin,
DeleteMessageView,
InheritanceCreateView,
InheritanceListView,
InheritanceUpdateView, UserPaginateListMixin,
InheritanceUpdateView,
UserPaginateListMixin,
)
from passbook.core.models import Provider
class ProviderListView(LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView):
class ProviderListView(
LoginRequiredMixin, PermissionListMixin, UserPaginateListMixin, InheritanceListView
):
"""Show list of all providers"""
model = Provider
@ -28,6 +32,7 @@ class ProviderListView(LoginRequiredMixin, PermissionListMixin, UserPaginateList
class ProviderCreateView(
SuccessMessageMixin,
BackSuccessUrlMixin,
LoginRequiredMixin,
DjangoPermissionRequiredMixin,
InheritanceCreateView,
@ -44,6 +49,7 @@ class ProviderCreateView(
class ProviderUpdateView(
SuccessMessageMixin,
BackSuccessUrlMixin,
LoginRequiredMixin,
PermissionRequiredMixin,
InheritanceUpdateView,