Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
875a069a
Commit
875a069a
authored
Jul 16, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改校验规则
parent
106abc24
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
cmd_filter.py
apps/assets/serializers/cmd_filter.py
+3
-0
No files found.
apps/assets/serializers/cmd_filter.py
View file @
875a069a
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment