diff --git a/connect.py b/connect.py index 4e2f680ed..b3bc119c8 100644 --- a/connect.py +++ b/connect.py @@ -155,8 +155,8 @@ def get_user_host(username): hosts = {} try: user = User.objects.get(username=username) - except AttributeError, ObjectDoesNotExist: - red_print("Don't Use Root To Do That or User isn't Exist.") + except ObjectDoesNotExist: + return {'Error': 'username %s is not exist.' % username} else: perm_all = user.permission_set.all() for perm in perm_all: