def box_set_admin_view(account_dir, box_dir): re = biz.box_usable(account_dir, box_dir) if re.errcode == model.HAVEDIR : try: re = biz.box_biz.box_user_level(account_dir, box_dir,session['dir']) if re.errcode != model.OK : lev = 0 else : lev = re.data except KeyError: lev = 0 v = biz.account_biz.visit_dir(account_dir) box = biz.box_biz.get_box(account_dir, box_dir) admin = biz.get_account_by_id(box.data.admin) box.data.admin = admin.data if lev<3 : return "权限不足" return render_template(config.VIEW+'/box_set_admin.html', box = box.data, account=v.data, account_dir=account_dir, box_dir=box_dir, lev=lev) else : return render_template(config.VIEW+'/404.html')