You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If any IP device attached to an existing and active maintenance task is deleted from NAV, the active maintenance task view will crash with a AttributeError.
To Reproduce
Steps to reproduce the behavior:
Create a temporary IP Device called "A"
Add A to a maintenance task (e.g. immediate maintenance)
Go to the maintenance tool and click the "Active tab"
See error
Expected behavior
A list of active maintenance tasks should be displayed, no matter whether they have missing components.
Traceback
Internal Server Error: /maintenance/active/
AttributeError at /maintenance/active/
'DoesNotExist' object has no attribute 'message'
Request Method: GET
Request URL: https://nav.example.org/maintenance/active/
Django Version: 1.11.26
Python Executable: /usr/bin/uwsgi-core
Python Version: 3.5.3
Python Path: ['.', '', '/opt/venvs/nav/lib/python35.zip', '/opt/venvs/nav/lib/python3.5', '/opt/venvs/nav/lib/python3.5/plat-x86_64-linux-gnu', '/opt/venvs/nav/lib/python3.5/lib-dynload', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/opt/venvs/nav/lib/python3.5/site-packages', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages', '/opt/venvs/nav/lib/python3.5/site-packages', '/etc/nav/python']
Server time: Wed, 18 Dec 2019 09:37:04 +0100
Installed Applications:
('nav.models',
'nav.web',
'nav.django',
'django.contrib.staticfiles',
'django.contrib.sessions',
'django.contrib.humanize',
'django_filters',
'crispy_forms',
'crispy_forms_foundation',
'rest_framework',
'nav.auditlog',
'nav.web.macwatch',
'nav.web.geomap',
'nav.web.portadmin',
'django.contrib.postgres')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'nav.web.auth.AuthenticationMiddleware',
'nav.web.auth.AuthorizationMiddleware',
'nav.django.legacy.LegacyCleanupMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/opt/venvs/nav/lib/python3.5/site-packages/nav/web/maintenance/views.py" in active
130. netbox = Netbox.objects.get(pk=int(netbox_id))
File "/opt/venvs/nav/lib/python3.5/site-packages/django/db/models/manager.py" in manager_method
85. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/venvs/nav/lib/python3.5/site-packages/django/db/models/query.py" in get
380. self.model._meta.object_name
During handling of the above exception (Netbox matching query does not exist.), another exception occurred:
File "/opt/venvs/nav/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/opt/venvs/nav/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/opt/venvs/nav/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/venvs/nav/lib/python3.5/site-packages/nav/web/maintenance/views.py" in active
133. netbox_id, get_ex.message)
Exception Type: AttributeError at /maintenance/active/
Exception Value: 'DoesNotExist' object has no attribute 'message'
Environment (please complete the following information):
NAV version installed: 5.0.2
The text was updated successfully, but these errors were encountered:
Describe the bug
If any IP device attached to an existing and active maintenance task is deleted from NAV, the active maintenance task view will crash with a
AttributeError
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
A list of active maintenance tasks should be displayed, no matter whether they have missing components.
Traceback
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: