mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 08:25:17 -06:00
added app namespaces to the context data
This commit is contained in:
parent
7a953fa5ef
commit
b50ce17f57
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user