openwisp / openwisp/openwisp-users

[bug] `FilterSerializerByOrganization` filters fields without organization

Open
#319 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
179
Forks
96
Avg merge
13h 40m
Merged PRs (30d)
16

Description

FilterSerializerByOrganization filters queryset of all related fields using the organization_lookup. But, it might be possible that a model does not have relation to Organization (not even an indirect one, e.g. WiFiClient in openwisp-monitoring).

We should allow to exclude fields from the organization filtering.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating FilterSerializerByOrganization and trace how organization_lookup is applied to related fields. Review the WiFiClient example and the linked discussion for the missing-organization case; done means callers can exclude fields with no Organization relation without breaking existing organization filtering.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
authorization, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.