So why not just use the following:

    data['device_types'] = [device for device in mock_app['device_type'] if device[1]]