Extend 500 error template to list installed plugins

This commit is contained in:
Jeremy Stretch 2023-08-04 15:55:51 -04:00
parent 3597f79235
commit 82180ecf42
2 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,8 @@ from django.views.defaults import ERROR_500_TEMPLATE_NAME, page_not_found
from django.views.generic import View
from sentry_sdk import capture_message
from extras.plugins.utils import get_installed_plugins
__all__ = (
'handler_404',
'handler_500',
@ -53,4 +55,5 @@ def handler_500(request, template_name=ERROR_500_TEMPLATE_NAME):
'exception': str(type_),
'netbox_version': settings.VERSION,
'python_version': platform.python_version(),
'plugins': get_installed_plugins(),
}))

View File

@ -30,7 +30,10 @@
{{ error }}
Python version: {{ python_version }}
NetBox version: {{ netbox_version }}</pre>
NetBox version: {{ netbox_version }}
Plugins: {% for plugin, version in plugins.items %}
{{ plugin }}: {{ version }}{% empty %}None installed{% endfor %}
</pre>
<p>
If further assistance is required, please post to the <a href="https://github.com/netbox-community/netbox/discussions">NetBox discussion forum</a> on GitHub.
</p>