示例#1
0
文件: views.py 项目: agibsonccc/hue
def refresh_catalog(request):
  if request.method != 'POST':
    raise PopupException(_('A POST request is required.'))

  try:
    db = server.get(request.user)
    res = db.resetCatalog()
    response = {'status': res.status_code, 'data': res.error_msgs}
  except Exception, e:
    response = {'status': -1, 'data': str(e)}
示例#2
0
文件: views.py 项目: ozzie00/hue
def refresh_catalog(request):
    if request.method != 'POST':
        raise PopupException(_('A POST request is required.'))

    try:
        db = server.get(request.user)
        res = db.resetCatalog()
        response = {'status': res.status_code, 'data': res.error_msgs}
    except Exception, e:
        response = {'status': -1, 'data': str(e)}
示例#3
0
文件: views.py 项目: Roxasora/hue
def refresh_catalog(request):
  response = {'status': -1, 'message': ''}

  if request.method != 'POST':
    response['message'] = _('A POST request is required.')
  else:
    try:
      db = server.get(request.user)
      res = db.resetCatalog()
      response = {'status': res.status.status_code, 'message': res.status.error_msgs}
    except Exception, e:
      response = {'message': str(e)}
示例#4
0
def refresh_catalog(request):
    response = {'status': -1, 'message': ''}

    if request.method != 'POST':
        response['message'] = _('A POST request is required.')
    else:
        try:
            db = server.get(request.user)
            res = db.resetCatalog()
            response = {
                'status': res.status.status_code,
                'message': res.status.error_msgs
            }
        except Exception, e:
            response = {'message': str(e)}