Skip to content

Remove FixLookupAllowedMixin for Django 6.x#157

Open
cuthulino wants to merge 1 commit intoboxine:mainfrom
cuthulino:remove_lookup_allowed
Open

Remove FixLookupAllowedMixin for Django 6.x#157
cuthulino wants to merge 1 commit intoboxine:mainfrom
cuthulino:remove_lookup_allowed

Conversation

@cuthulino
Copy link
Copy Markdown

In Django 6.x the lookup_allowed function takes 4 arguments (it where 3 before).
Therefore filtering on the admin page is no longer working.

class FixLookupAllowedMixin:
"""
Work-a-round for: https://code.djangoproject.com/ticket/35020
# FIXME: Remove after release into all supported Django versions.
"""
def lookup_allowed(self, lookup, value):
list_filter = self._get_list_filter()
if lookup in list_filter:
return True
return super().lookup_allowed(lookup, value)
def _get_list_filter(self):
"""return list_filter without `request` object."""
raise NotImplementedError()
def get_list_filter(self, request):
return self._get_list_filter()

My PR completely removes the FixLookupAllowedMixin.
In my opinion it is no longer needed.
Found no error while testing it.

If you want to keep it, I also got a branch where I only fix the error: https://github.com/cuthulino/django-huey-monitor/tree/fix_lookup_allowed

Would be nice to have this in a new verion working with django 6.x

@cuthulino
Copy link
Copy Markdown
Author

@jedie or @phihag
Could you take a look at this?
Thanks.

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.

1 participant