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
commit dbd72282bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 - EnumField improvements: now `choices` limits the values of an enum to allow
- Fix deepcopy of EmbeddedDocument #2202 - Fix deepcopy of EmbeddedDocument #2202
- Fix error when using precision=0 with DecimalField #2535 - 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 Changes in 0.23.1
=========== ===========

View File

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