openwisp / openwisp/openwisp-users

[feature] MultitenantAdminMixin: filter by the organization of the object if obejct exists

Open
#281 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

We may be able to restrict the queryset of fields which relate to other models so that only objects that relate to the organization of the parent are shown.

We have to be careful in handling different cases:

  • Normal django admin change/add pages (new objects don't have any org set so it can't be done)
  • Inlines (maybe we can implement it here too but we should provide a way to disable it if needed)

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 MultitenantAdminMixin and the Django admin change/add and inline entry points it affects. Trace how related-model querysets are built, then define behavior for existing objects, new objects without an organization, and inlines, including how inline filtering can be disabled; the work is done when these cases are consistently handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
authorization, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.