Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
SearchFilter.get_search_terms returns list.#9338
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
jthevos left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
🚢 🚢 🚢
| defsearch_smart_split(search_terms): | ||
| """generator that first splits string by spaces, leaving quoted phrases together, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Came fromyour haiku
Just to add 🐼 comment
Docstring needs fix
(“generator” -> Create list)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'll put up a PR for it!
| field=CharField(trim_whitespace=False,allow_blank=True) | ||
| returnfield.run_validation(value) | ||
| cleaned_value=field.run_validation(value) | ||
| returnsearch_smart_split(cleaned_value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This could have been done by simply changing to
returnlist(search_smart_split(cleaned_value))
There is no point to changing the return value and definition ofsearch_smart_split.
sevdog commentedMar 22, 2024
PS: an anti-regression test should be implemented to avoid this, since both older and new versions passed the same tests without any failure. |
Uh oh!
There was an error while loading.Please reload this page.
#9017 unintentionally treated
SearchFilter.get_search_termsas a private method, changing its signature from a list of strings, to a string.This pull request reverts that change, by pulling the
"search_smart_split"inside the method, ensuring that search terms are correctly tokenised by"quoted strings like this"andcomma,sperated,strings,like,this.Closes#9308