def home(request): """ 首页 """ client = get_client_by_request(request) client.set_bk_api_ver('v2') app_list = get_app_by_user(request.COOKIES['bk_token']) for x in app_list: if x.get("app_name") == u'\u8d44\u6e90\u6c60' or x.get("app_name") == 'Resource pool': app_list.remove(x) break return render_mako_context(request, '/home_application/home.html', {'bizList': app_list})
def history(request): """ 查看历史页面 """ client = get_client_by_request(request) client.set_bk_api_ver('v2') # 根据权限查询业务列表 bk_biz_list = get_app_by_user(request.COOKIES['bk_token']) for x in bk_biz_list: if x.get("app_name") == u'\u8d44\u6e90\u6c60' or x.get( "app_name") == 'Resource pool': bk_biz_list.remove(x) break return render_mako_context(request, '/home_application/history.html', {'bk_biz_list': bk_biz_list})