diff --git a/netbox/dcim/api/views.py b/netbox/dcim/api/views.py index b39f09f17..760133a33 100644 --- a/netbox/dcim/api/views.py +++ b/netbox/dcim/api/views.py @@ -438,11 +438,10 @@ class DeviceViewSet( app_ns = registry['model_features']['custom_fields'].keys() for app in app_ns: + context_data.setdefault(app, {}) models = apps.get_app_config(app).get_models() for model in models: - context_data.update({ - model.__name__: model - }) + context_data[app][model.__name__] = model return self.render_configtemplate(request, configtemplate, context_data) diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index 1d667d67c..0598be34f 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -2084,11 +2084,10 @@ class DeviceRenderConfigView(generic.ObjectView): app_ns = registry['model_features']['custom_fields'].keys() for app in app_ns: + context_data.setdefault(app, {}) models = apps.get_app_config(app).get_models() for model in models: - context_data.update({ - model.__name__: model - }) + context_data[app][model.__name__] = model # Render the config template rendered_config = None