Remove print statement & correct code return

This commit is contained in:
wcolmenares 2019-05-16 13:33:31 -04:00
parent 69ec7d2b46
commit ce630573e0

View file

@ -1773,7 +1773,6 @@ class CheckUserVM(APIView):
user = request.data['user'] user = request.data['user']
realm = request.data['realm'] realm = request.data['realm']
token = request.data['token'] token = request.data['token']
print(settings.ACCOUNT_NAME)
if user != settings.ACCOUNT_NAME: if user != settings.ACCOUNT_NAME:
return Response("User not allowed", 403) return Response("User not allowed", 403)
response = check_otp(user, realm, token) response = check_otp(user, realm, token)
@ -1784,8 +1783,8 @@ class CheckUserVM(APIView):
for i in range(len(uservms)): for i in range(len(uservms)):
if uservms[i].ipv4 == ip or uservms[i].ipv6 == ip: if uservms[i].ipv4 == ip or uservms[i].ipv6 == ip:
return Response('success', 200) return Response('success', 200)
return Response('No VM found matching the ip address provided', 403) return Response('No VM found matching the ip address provided', 404)
else: else:
return Response('No VM found with the given email address', 403) return Response('No VM found with the given email address', 404)
except KeyError: except KeyError:
return Response('Not enough data provided', 400) return Response('Not enough data provided', 400)