From 25e72499572ac8974243faee5e61213877bf74b7 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 14 Jun 2023 20:39:03 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=AD=A3=E5=88=99?= =?UTF-8?q?=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/db/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/common/db/fields.py b/apps/common/db/fields.py index b1cdc76d6..2cd8edc2b 100644 --- a/apps/common/db/fields.py +++ b/apps/common/db/fields.py @@ -474,7 +474,7 @@ class JSONManyToManyDescriptor: res &= str(value).endswith(str(rule_value)) elif rule_match == 'regex': try: - matched = bool(re.match(rule_value, value)) + matched = bool(re.search(r'{}'.format(rule_value), value)) except Exception as e: logging.error('Error regex match: %s', e) matched = False