Commit 875a069a authored by ibuler's avatar ibuler

[Update] 修改校验规则

parent 106abc24
......@@ -36,6 +36,9 @@ class CommandFilterRuleSerializer(BulkOrgResourceModelSerializer):
list_serializer_class = AdaptedBulkListSerializer
def validate_content(self, content):
tp = self.initial_data.get("type")
if tp == CommandFilterRule.TYPE_REGEX:
return content
if self.invalid_pattern.search(content):
invalid_char = self.invalid_pattern.pattern.replace('\\', '')
msg = _("Content should not be contain: {}").format(invalid_char)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment