def has_permission(self, request, view):
    if (request.user.is_two_factor_enabled and user_has_device(request.user)):
        return otp_is_verified(request)
    else:
        return True
def has_permission(self, request, view):
    if (request.user.is_two_factor_enabled and user_has_device(request.user)):
        return otp_is_verified(request)
    else:
        return True