From 7bfb1d19fe1d7d4babf1ee2ddea26ad2c3b080fd Mon Sep 17 00:00:00 2001 From: yumaojun <719118794@qq.com> Date: Tue, 23 Feb 2016 23:04:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsudo=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E3=80=80=E5=B0=8F=E5=86=99all=20=E5=BC=95=E8=B5=B7=E7=9A=84?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jperm/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jperm/views.py b/jperm/views.py index 2f3e07762..444934901 100644 --- a/jperm/views.py +++ b/jperm/views.py @@ -621,7 +621,7 @@ def perm_sudo_add(request): pattern = re.compile(r'[\n,\r]') deal_commands = list_drop_str(pattern.split(commands), u'') for command in deal_commands: - if command.lower() == "all": + if command.strip().lower() == "all": deal_commands.remove(command) deal_commands.append(command.upper()) commands = ', '.join(deal_commands) @@ -663,7 +663,7 @@ def perm_sudo_edit(request): pattern = re.compile(r'[\n,\r]') deal_commands = list_drop_str(pattern.split(commands), u'') for command in deal_commands: - if command.lower() == "all": + if command.strip().lower() == "all": deal_commands.remove(command) deal_commands.append(command.upper()) commands = ', '.join(deal_commands).strip()