Merge pull request #2574 from bagerard/update_changelog_recent_merge

update changelog with recent changes that were merged
This commit is contained in:
Bastien Gérard
2021-10-13 09:27:52 +02:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ Development
- EnumField improvements: now `choices` limits the values of an enum to allow
- Fix deepcopy of EmbeddedDocument #2202
- Fix error when using precision=0 with DecimalField #2535
- Add support for regex and whole word text search query #2568
Changes in 0.23.1
===========

View File

@@ -162,10 +162,10 @@ class StringField(BaseField):
elif op == "regex":
regex = value
# escape unsafe characters which could lead to a re.error
if op == "regex":
value = re.compile(regex, flags)
else:
# escape unsafe characters which could lead to a re.error
value = re.escape(value)
value = re.compile(regex % value, flags)
return super().prepare_query_value(op, value)