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

Release/2.4.1 #35

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.3.1
current_version = 2.4.1
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<release>\d+)
serialize = {major}.{minor}.{release}
commit = False
Expand Down
9 changes: 7 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
Release 2.4.1
=============
* Fixes bug in AutiCompleteFilter


Release 2.4
=================
===========
* Django 5.x support


Release 2.3.1
===============
=============
* Bug fixes


Expand Down
2 changes: 1 addition & 1 deletion src/adminfilters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME = "django-adminfilters"
VERSION = __version__ = "2.4"
VERSION = __version__ = "2.4.1"
__author__ = "sax"
24 changes: 12 additions & 12 deletions src/adminfilters/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,18 @@
self.parent_lookup_kwarg = f"{self.parent}__exact"
super().__init__(field, request, params, model, model_admin, field_path)
for pos, entry in enumerate(model_admin.list_filter):
if (
isinstance(entry, (list, tuple))
and len(entry) == 2
and entry[0] != self.field_path
and entry[1].__name__ == type(self).__name__
and entry[1].parent == self.field_path
):
kwarg = f"{entry[0]}__exact"
if entry[1].parent:
if kwarg not in self.dependants:
self.dependants.extend(entry[1].dependants)
self.dependants.append(kwarg)
if isinstance(entry, (list, tuple)):
if (
len(entry) == 2
and entry[0] != self.field_path
and entry[1].__name__ == type(self).__name__
and entry[1].parent == self.field_path
):
kwarg = f"{entry[0]}__exact"

Check warning on line 124 in src/adminfilters/autocomplete.py

View check run for this annotation

Codecov / codecov/patch

src/adminfilters/autocomplete.py#L124

Added line #L124 was not covered by tests
if entry[1].parent:
if kwarg not in self.dependants:
self.dependants.extend(entry[1].dependants)
self.dependants.append(kwarg)

Check warning on line 128 in src/adminfilters/autocomplete.py

View check run for this annotation

Codecov / codecov/patch

src/adminfilters/autocomplete.py#L127-L128

Added lines #L127 - L128 were not covered by tests

def has_output(self):
if self.parent:
Expand Down
Loading