Image attachment API endpoint raises AttributeError exception #3909

Closed
opened 2025-12-29 18:31:55 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jul 27, 2020).

Environment

  • Python version: v3.6.9
  • NetBox version: v2.9-beta1

Steps to Reproduce

  1. Navigate to the image attachments REST API endpoint: /api/extras/image-attachments/

Expected Behavior

The endpoint should return a normal response.

Observed Behavior

An AttributeError exception is raised: 'QuerySet' object has no attribute 'restrict'.

This occurs because the ImageAttachment model does not use a RestrictedQuerySet manager as its default manager. (Unfortunately, this was not caught by CI because no tests have been written for this endpoint.)

Originally created by @jeremystretch on GitHub (Jul 27, 2020). ### Environment * Python version: v3.6.9 * NetBox version: v2.9-beta1 ### Steps to Reproduce 1. Navigate to the image attachments REST API endpoint: `/api/extras/image-attachments/` ### Expected Behavior The endpoint should return a normal response. ### Observed Behavior An AttributeError exception is raised: `'QuerySet' object has no attribute 'restrict'`. This occurs because the ImageAttachment model does not use a RestrictedQuerySet manager as its default manager. (Unfortunately, this was not caught by CI because no tests have been written for this endpoint.)
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 18:31:55 +01:00
adam closed this issue 2025-12-29 18:31:55 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3909