Skip to content

exception when attaching an image to a location #8077

@mcwb

Description

@mcwb

NetBox version

v3.1.1

Python version

3.8

Steps to Reproduce

  1. Create a site, and a location under the site
  2. View the location
  3. Click the 'Attach an image' button on the location view
  4. attach a jpg (or png) with a name 1234 and a filename 1234.jpg (any name will do)
  5. Click Create

Expected Behavior

An image should have been uploaded and viewable from the location view

Observed Behavior

Server Error
There was a problem with your request. Please contact an administrator.

A server error occurred instead. The complete exception is provided below:

<class 'Exception'>

Unexpected type of parent object for ImageAttachment

Python version: 3.8.10
NetBox version: 3.1.1

Note that the file is successfully uploaded to the media directory (/opt/netbox/netbox/media/image-attachments) despite the exception.
Note that any image of any size triggers exception.
Note that exception does not occur if image is uploaded to a site, rack or device type
Note that the exception occurs if image is uploaded to a location, circuit or power panel

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions