Skip to content

AttributeError when logged out user tries to export devices #22397

@fabi125

Description

@fabi125

NetBox Edition

NetBox Community

NetBox Version

v4.6.2

Python Version

3.12

Steps to Reproduce

  1. Allow view access to NetBox for unauthenticated users.
  2. Open up a random UI list view, e.g. http://netbox/dcim/devices/
  3. Click on Export -> Current View

Expected Behavior

CSV export works.

Observed Behavior

You get a 500:

<class 'AttributeError'>

'AnonymousUser' object has no attribute 'config'

Python version: 3.12.13
NetBox version: 4.6.2

Code location: https://github.com/netbox-community/netbox/blob/v4.6.2/netbox/netbox/views/generic/bulk_views.py#L184

The error is similar to the one reported in #21784 and similar to there, I'd be happy to put up a PR to fix this by guarding it behind request.user.is_authenticated (I might also check if there are other places in the code that have the same pattern so maybe we can fix them all together).

Metadata

Metadata

Assignees

Labels

netboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions