'Manager' object has no attribute 'restrict' after adding script count widget in dashboard #9148

Closed
opened 2025-12-29 20:46:17 +01:00 by adam · 3 comments
Owner

Originally created by @markkuleinio on GitHub (Jan 25, 2024).

Originally assigned to: @arthanson on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.7.1

Python Version

3.11

Steps to Reproduce

In the dashboard:

  1. Unlock Dashboard
  2. Add Widget
  3. Widget type = Object Counts
  4. Models = Extras > Scripts
  5. Save

Expected Behavior

There is a widget in the dashboard that shows the number of scripts

Observed Behavior

image

<class 'AttributeError'>
'Manager' object has no attribute 'restrict'

Dashboard reset (/extras/dashboard/reset/) is required to be able to use the home page again.

Originally created by @markkuleinio on GitHub (Jan 25, 2024). Originally assigned to: @arthanson on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.7.1 ### Python Version 3.11 ### Steps to Reproduce In the dashboard: 1. Unlock Dashboard 2. Add Widget 3. Widget type = Object Counts 4. Models = Extras > Scripts 5. Save ### Expected Behavior There is a widget in the dashboard that shows the number of scripts ### Observed Behavior ![image](https://github.com/netbox-community/netbox/assets/25136274/f0998512-acbe-46a5-bcd8-b100a846beb1) **<class 'AttributeError'> 'Manager' object has no attribute 'restrict'** Dashboard reset (/extras/dashboard/reset/) is required to be able to use the home page again.
adam added the type: bugstatus: blockedseverity: low labels 2025-12-29 20:46:17 +01:00
adam closed this issue 2025-12-29 20:46:17 +01:00
Author
Owner

@llamafilm commented on GitHub (Feb 2, 2024):

I just ran into the same problem. Before I found this page with the fix, I managed to fix it in nbshell like this, after inspecting the User to find the right ID.

>>> dash = Dashboard.objects.get(id=16)
>>> dash.delete_widget(id='a04674a6-6344-46f8-b677-6a9e6443277a')
>>> dash.full_clean()
>>> dash.save()
@llamafilm commented on GitHub (Feb 2, 2024): I just ran into the same problem. Before I found this page with the fix, I managed to fix it in nbshell like this, after inspecting the `User` to find the right ID. ``` >>> dash = Dashboard.objects.get(id=16) >>> dash.delete_widget(id='a04674a6-6344-46f8-b677-6a9e6443277a') >>> dash.full_clean() >>> dash.save() ```
Author
Owner

@arthanson commented on GitHub (Feb 20, 2024):

blocked by #14438

@arthanson commented on GitHub (Feb 20, 2024): blocked by #14438
Author
Owner

@arthanson commented on GitHub (Feb 27, 2024):

This will be fixed in NB 4.0 via #14438

@arthanson commented on GitHub (Feb 27, 2024): This will be fixed in NB 4.0 via #14438
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9148