@never_cache
def update_link(request, link):
  response = {
    'status': 0,
    'errors': None,
    'link': None
  }

  if request.POST not in 'link':
    raise StructuredException(code="INVALID_REQUEST_ERROR", message=_('Error saving link'), data={'errors': 'Link is missing.'}, error_code=400)

  link.update_from_dict(json.loads(smart_str(request.POST['link'])))

  try:
    c = client.SqoopClient(conf.SERVER_URL.get(), request.user.username, request.LANGUAGE_CODE)
    response['link'] = c.update_link(link).to_dict()
  except RestException, e:
    response.update(handle_rest_exception(e, _('Could not update link.')))
  except SqoopException, e:
    response['status'] = 100
    response['errors'] = e.to_dict()
  return JsonResponse(response)
dataset/ETHPy150Open cloudera/hue/apps/sqoop/src/sqoop/api/link.py/update_link/swapped operands of `not in`