mysociety / contract-countdown

https://mysociety.github.io/contract-countdown/
0 stars 0 forks source link

Council search #44

Open alexander-griffen opened 1 year ago

alexander-griffen commented 1 year ago

Currently, the search boc for councils and postcodes in the home page searches for a case-insensitive exact match for a council (assuming it isn't a postcode).

This may need to be changed in future: (Comment from @zarino on a relevant pull request):

Most people will never reach this point in the code, because they’ll already have been redirected by the JavaScript autocomplete. But on the off chance that someone has JavaScript disabled, and submits the form with something like "liverpool" in the search field, I feel like we should do something more useful than just showing them an "invalid council" error message.

This does raise an issue, though, that a substring filter may return multiple matching councils (eg: "liverpool" in my example above, could be Liverpool City Council or Liverpool City Region Combined Authority) and just calling .first() might not result in the council the user intended … so we’d probably need to present a disambiguation page, somehow. Sigh.

Maybe leave it as name__iexact for now, and open a ticket to replace it with something better, if we go on to develop the alpha further?