openwisp-controller
openwisp-controller copied to clipboard
[Fix] Resolve 500 FieldError on DeviceLocationView #1110
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.