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
When I modify a maintenance task, I get an internal server error.
To Reproduce
Steps to reproduce the behavior:
Go to 'Maintenance tasks'
Click on 'Active'
Click on 'Description Task'
Click on 'Edit'
See error
Tracebacks
Traceback (most recent call last):
File "/opt/venvs/nav/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/opt/venvs/nav/lib/python3.7/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3.7/contextlib.py", line 74, in inner
return func(*args, **kwds)
File "/opt/venvs/nav/lib/python3.7/site-packages/nav/web/maintenance/views.py", line 288, in edit
if component_keys_errors:
UnboundLocalError: local variable 'component_keys_errors' referenced before assignment
Environment (please complete the following information):
If the problem is with the web ui: Linux or Windows, Firefox or Brave
OS on the NAV server : Debian 10
NAV version installed 5.8.3
Method of installation from Debian package
The text was updated successfully, but these errors were encountered:
Due to the convoluted logic of the edit() function, multiple variables
may be referenced before proper assignment unless they are given a
value of `None` first.
Unfortunately, at least two such variables were potentially referenced
without being initialized first (among other things, causing the
crash mentioned in Uninett#2783).
This ensures all variables that may remain "unassigned" are initialized
to `None` at the start of the function.
Describe the bug
When I modify a maintenance task, I get an internal server error.
To Reproduce
Steps to reproduce the behavior:
Tracebacks
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: