yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.8k stars 468 forks source link

Created tags are named `Create "tag_text"` #1133

Open PeteAndersen opened 4 years ago

PeteAndersen commented 4 years ago

Using DAL + django-taggit. When tag creation is enabled, the created tags are including the Create "<text>" boilerplate from the widget in the tag name. For example, if I type foo, and a tag named foo does not exist, the widget gives me the option Create "foo". Clicking on it sends a POST request to the autocomplete view with the text field set literally to Create "foo" instead of just foo, and the tag is created with the full text.

Additionally, the widget displays 2 options even though no tags exist: foo and Create "foo". Clicking just on foo selects a tag that doesn't exist. It appears that DAL tries to create the object on its own but not through the create_object() function, which I need to override to provide additional fields for the tag model.

jpic commented 4 years ago

I think you don't need the Create function with taggit, because taggit will always create new tags.