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
When editing a "filter group" in the Alert Profiles web tool, if a user clicks the "Move up" or "Move down" button for any of multiple filters in a group, the UI crashes with a Python RuntimeError
Expected behavior
The filter position should be moved within the filter group, no crash.
Tracebacks
Environment:
Request Method: POST
Request URL: http://localhost/alertprofiles/filter-groups/remove-filter/
Django Version: 3.2.25
Python Version: 3.9.2
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.portadmin.napalm',
'nav.web.portadmin',
'django.contrib.postgres')
Installed Middleware:
('django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'nav.web.auth.middleware.AuthenticationMiddleware',
'nav.web.auth.middleware.AuthorizationMiddleware',
'nav.django.legacy.LegacyCleanupMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback (most recent call last):
File "/opt/venvs/nav/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/opt/venvs/nav/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/source/python/nav/web/alertprofiles/decorators.py", line 47, in _handlerreturn func(request, *args, **kwargs)
File "/source/python/nav/web/alertprofiles/views.py", line 2053, in filter_group_remove_or_move_filterfor name in post:
Exception Type: RuntimeError at /alertprofiles/filter-groups/remove-filter/
Exception Value: dictionary keys changed during iteration
Environment (please complete the following information):
OS on the NAV server: Any
NAV version installed: 5.10.2
The text was updated successfully, but these errors were encountered:
This was reported by RENU. Not sure why this silly bug wasn't reported by anyone before, but it seems to be something that got lost a few years back when NAV moved from Python 2 to 3: Dictionary elements cannot be deleted while iterating over its elements under Python 3.
Describe the bug
When editing a "filter group" in the Alert Profiles web tool, if a user clicks the "Move up" or "Move down" button for any of multiple filters in a group, the UI crashes with a Python
RuntimeError
Expected behavior
The filter position should be moved within the filter group, no crash.
Tracebacks
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: