openwisp-controller icon indicating copy to clipboard operation
openwisp-controller copied to clipboard

[Fix] Resolve 500 FieldError on DeviceLocationView #1110

Open stktyagi opened this issue 2 months ago • 1 comments

Adding organization_lookup = 'organization__in' to the view forces it to use the correct organization field and prevents the crash.

Fixes #1110

Checklist

  • [x] I have read the OpenWISP Contributing Guidelines.
  • [x] I have manually tested the changes proposed in this pull request.
  • [ ] I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • [ ] I have updated the documentation.

Reference to Existing Issue

Closes #1110

Description of Changes

The permission mixin was incorrectly using the child's organization path (content_object__organization) to filter the parent Device including organization_lookup = 'organization__in' to the view fixes it.

stktyagi avatar Oct 24 '25 12:10 stktyagi

Coverage Status

coverage: 98.607%. remained the same when pulling 70c1c7b9b62e5372d7c7cbc815d62278b820a5ae on issues/1110-crash-without-superuser-permission into 691bae85a6759334f2b24a5ee074732a8a1dd840 on master.

coveralls avatar Oct 24 '25 12:10 coveralls