Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelUserFieldPermissionMixin: fix error in checking for the right user of an edited model instance #1784

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

HenryJobst
Copy link

The mixin so far test for the right user against the first entry of Model.objects.all(). This entry has, most of the time, nothing to do with the actual entry (to edit/update/delete). Now the mixin tests the actual user against the user of the actual model instance given by pk or slug.
Fix tests accordingly. Until now, the tests for the mixin confirm the produced results (anonymous user) and test not the real expectation (second user can't get data of the first user).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant