mirror of https://github.com/jumpserver/jumpserver
[Update] 修改校验规则
parent
106abc24f8
commit
875a069a18
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue