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

ValueError if HTMXAutoComplete.get_items values is empty string #53

Open
H4rryK4ne opened this issue Jan 5, 2024 · 0 comments
Open

Comments

@H4rryK4ne
Copy link

Hi,

I played around with your example.

I created a view:

# my_app/view.py
from autocomplete import widgets
from django.shortcuts import render

# class MultipleFormModel ...

def index(request):
    form = MultipleFormModel(request.GET)
    return render(request, "base.html", {"form": form})

If I call the with http://localhost:8000/?name=Foo&members= (empty member list) I get an unexpected exception.
If I create the ModelForm without the AutoComplete widget I only get the error message that "" is not a valid value.

It seems to me, that it is not sufficient to check if values is not None

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

No branches or pull requests

1 participant