Browse Source

Fixes: #16144 GetReturnURLMixin Support for Plugin Views (#18996)

* Add plugin support to GetReturnURLMixin

* use get_viewname instead of resolving the name
Renato Almeida de Oliveira 10 tháng trước cách đây
mục cha
commit
7d80a45bf8
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  1. 1 2
      netbox/utilities/views.py

+ 1 - 2
netbox/utilities/views.py

@@ -149,9 +149,8 @@ class GetReturnURLMixin:
 
 
         # Attempt to dynamically resolve the list view for the object
         # Attempt to dynamically resolve the list view for the object
         if hasattr(self, 'queryset'):
         if hasattr(self, 'queryset'):
-            model_opts = self.queryset.model._meta
             try:
             try:
-                return reverse(f'{model_opts.app_label}:{model_opts.model_name}_list')
+                return reverse(get_viewname(self.queryset.model, 'list'))
             except NoReverseMatch:
             except NoReverseMatch:
                 pass
                 pass