Commit 1f15f13a authored by ibuler's avatar ibuler

修改bUg

parent fe70ca80
...@@ -155,8 +155,8 @@ def get_user_host(username): ...@@ -155,8 +155,8 @@ def get_user_host(username):
hosts = {} hosts = {}
try: try:
user = User.objects.get(username=username) user = User.objects.get(username=username)
except AttributeError, ObjectDoesNotExist: except ObjectDoesNotExist:
red_print("Don't Use Root To Do That or User isn't Exist.") return {'Error': 'username %s is not exist.' % username}
else: else:
perm_all = user.permission_set.all() perm_all = user.permission_set.all()
for perm in perm_all: for perm in perm_all:
......
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