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
All users are assigned an initial dashboard when they are created. This dashboard is assigned as their "default" dashboard, meaning this is the dashboard that will displayed first when visiting the NAV home page. The "default" dashboard can be reassigned at will by users.
However, a user will be able to delete their own default dashboard through the UI. When this happens, no dashboards will be assigned as the default for this user. Visiting the home page will still work, though it may be undefined which of the user's dashboards will now be displayed first.
Several parts of the NAV web UI that displays interactive graphs have a button labeled Add graph to dashboard. These are designed to add a graph to the user's default dashboard. However, when the user no longer has a dashboard marked as default, this XHR operation fails as the endpoint raises a 500 error and the button changes color to red (instead of green, which would indicate a successful operation).
To Reproduce
Steps to reproduce the behavior:
Go to the NAV home page.
Click on + to add a new dashboard, give it a name, such as foobar
Click the gear symbol on the right in order to change the new dashboard's properties.
Click the Set as default dashboard button to make this new dashboard the default dashboard.
Click Delete dashboard to remove the new default foobar dashboard entirely.
Browse any graph, such as the port traffic statistics of some port on some switch. Click the Add graph to dashboard button.
Observe the button changing its color to red (with web developer tools open, you will see the background XHR request returns a 500 error)
Expected behavior
A user should have exactly one default dashboard and the user should be prevented from deleting their default dashboard.
Screenshots
Tracebacks
Internal Server Error: /navlets/add-user-navlet/graph/
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/navlets/__init__.py", line 411, in add_user_navlet_graph
add_navlet(
File "/source/python/nav/web/navlets/__init__.py", line 285, in add_navlet
dashboard = AccountDashboard.objects.get(account=account, is_default=True)
File "/opt/venvs/nav/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_methodreturngetattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/venvs/nav/lib/python3.9/site-packages/django/db/models/query.py", line 435, in getraiseself.model.DoesNotExist(
nav.models.profiles.AccountDashboard.DoesNotExist: AccountDashboard matching query does not exist.
Environment (please complete the following information):
NAV version installed: 5.11.0
The text was updated successfully, but these errors were encountered:
Describe the bug
All users are assigned an initial dashboard when they are created. This dashboard is assigned as their "default" dashboard, meaning this is the dashboard that will displayed first when visiting the NAV home page. The "default" dashboard can be reassigned at will by users.
However, a user will be able to delete their own default dashboard through the UI. When this happens, no dashboards will be assigned as the default for this user. Visiting the home page will still work, though it may be undefined which of the user's dashboards will now be displayed first.
Several parts of the NAV web UI that displays interactive graphs have a button labeled
Add graph to dashboard
. These are designed to add a graph to the user's default dashboard. However, when the user no longer has a dashboard marked as default, this XHR operation fails as the endpoint raises a 500 error and the button changes color to red (instead of green, which would indicate a successful operation).To Reproduce
Steps to reproduce the behavior:
+
to add a new dashboard, give it a name, such asfoobar
Set as default dashboard
button to make this new dashboard the default dashboard.Delete dashboard
to remove the new defaultfoobar
dashboard entirely.Add graph to dashboard
button.Expected behavior
A user should have exactly one default dashboard and the user should be prevented from deleting their default dashboard.
Screenshots
Tracebacks
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: