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

* Add plugin support to GetReturnURLMixin

* use get_viewname instead of resolving the name
This commit is contained in:
Renato Almeida de Oliveira 2025-03-27 09:33:09 -03:00 committed by GitHub
parent 09854a3d54
commit 7d80a45bf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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