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

Handle check for many-to-many that works with taggit as well #179

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions wagtailautocomplete/edit_handlers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.core.exceptions import ImproperlyConfigured
from django.db.models import ManyToManyField
from django.utils.functional import cached_property
from wagtail.admin.panels import FieldPanel
from wagtail.coreutils import resolve_model_string
Expand All @@ -20,7 +19,7 @@ def _is_single_value(db_field):
Returns True if the given model field accepts a single value only.
"""
# should cover all many-to-many relationships
return not isinstance(db_field, ManyToManyField)
return not db_field.many_to_many


class AutocompletePanel(FieldPanel):
Expand Down