Fixes: #14840 - Better fix for netboxusers-list

This commit is contained in:
Daniel Sheppard 2024-01-26 15:31:36 -06:00
parent 979b71446d
commit 8be1f9d5a1

View File

@ -52,6 +52,8 @@ def get_viewname(model, action=None, rest_api=False):
# Alter the app_label for group and user model_name to point to users app
if app_label == 'auth' and model_name in ['group', 'user']:
app_label = 'users'
if app_label == 'users' and model._meta.proxy and model_name in ['netboxuser', 'netboxgroup']:
model_name = model._meta.proxy_for_model._meta.model_name
viewname = f'{app_label}-api:{model_name}'
# Append the action, if any