Commit 0832ea97 authored by yumaojun's avatar yumaojun

去除sudo 添加和修改是 空格会被识别为 分隔符的问题

parent f6c26a20
...@@ -584,7 +584,7 @@ def perm_sudo_add(request): ...@@ -584,7 +584,7 @@ def perm_sudo_add(request):
comment = request.POST.get("sudo_comment").strip() comment = request.POST.get("sudo_comment").strip()
commands = request.POST.get("sudo_commands").strip() commands = request.POST.get("sudo_commands").strip()
pattern = re.compile(r'[ \n,\r]') pattern = re.compile(r'[\n,\r]')
commands = ', '.join(list_drop_str(pattern.split(commands), u'')) commands = ', '.join(list_drop_str(pattern.split(commands), u''))
logger.debug(u'添加sudo %s: %s' % (name, commands)) logger.debug(u'添加sudo %s: %s' % (name, commands))
...@@ -617,7 +617,7 @@ def perm_sudo_edit(request): ...@@ -617,7 +617,7 @@ def perm_sudo_edit(request):
commands = request.POST.get("sudo_commands") commands = request.POST.get("sudo_commands")
comment = request.POST.get("sudo_comment") comment = request.POST.get("sudo_comment")
pattern = re.compile(r'[ \n,\r]') pattern = re.compile(r'[\n,\r]')
commands = ', '.join(list_drop_str(pattern.split(commands), u'')).strip() commands = ', '.join(list_drop_str(pattern.split(commands), u'')).strip()
logger.debug(u'添加sudo %s: %s' % (name, commands)) logger.debug(u'添加sudo %s: %s' % (name, commands))
......
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