From nobody Wed Jan 15 13:46:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of ovirt.org designates 66.187.230.42 as permitted sender) client-ip=66.187.230.42; envelope-from=kimchi-devel-bounces@ovirt.org; helo=lists.ovirt.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of ovirt.org designates 66.187.230.42 as permitted sender) smtp.mailfrom=kimchi-devel-bounces@ovirt.org; Return-Path: Received: from lists.ovirt.org (lists.phx.ovirt.org [66.187.230.42]) by mx.zohomail.com with SMTPS id 1486993108163273.0135686060478; Mon, 13 Feb 2017 05:38:28 -0800 (PST) Received: from lists.phx.ovirt.org (localhost [127.0.0.1]) by lists.ovirt.org (Postfix) with ESMTP id D2E498206FA; Mon, 13 Feb 2017 13:38:25 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lists.ovirt.org (Postfix) with ESMTPS id A884A8206EB for ; Mon, 13 Feb 2017 13:37:46 +0000 (UTC) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1DDXwxP110012 for ; Mon, 13 Feb 2017 08:37:46 -0500 Received: from e24smtp02.br.ibm.com (e24smtp02.br.ibm.com [32.104.18.86]) by mx0a-001b2d01.pphosted.com with ESMTP id 28k7jaftqs-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 13 Feb 2017 08:37:45 -0500 Received: from localhost by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Feb 2017 11:37:43 -0200 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 13 Feb 2017 11:37:41 -0200 Received: from d24relay02.br.ibm.com (d24relay02.br.ibm.com [9.18.232.42]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 3C75D352005F for ; Mon, 13 Feb 2017 08:37:07 -0500 (EST) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.8.31.93]) by d24relay02.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1DDbesC39714864 for ; Mon, 13 Feb 2017 11:37:40 -0200 Received: from d24av02.br.ibm.com (localhost [127.0.0.1]) by d24av02.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1DDbeDJ023367 for ; Mon, 13 Feb 2017 11:37:40 -0200 Received: from alinefm-TP440.ibmmodules.com ([9.85.175.177]) by d24av02.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1DDba2v023332 for ; Mon, 13 Feb 2017 11:37:39 -0200 X-Original-To: kimchi-devel@ovirt.org From: Aline Manera To: Kimchi Devel Date: Mon, 13 Feb 2017 11:37:29 -0200 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170213133735.10975-1-alinefm@linux.vnet.ibm.com> References: <20170213133735.10975-1-alinefm@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021313-0020-0000-0000-0000028677E2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021313-0021-0000-0000-000030A09C60 Message-Id: <20170213133735.10975-2-alinefm@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-13_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702130134 Subject: [Kimchi-devel] [PATCH] [Wok 1/7] Fix last page cookie setting X-BeenThere: kimchi-devel@ovirt.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: kimchi-devel-bounces@ovirt.org Errors-To: kimchi-devel-bounces@ovirt.org X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It was not considering that cherrypy.request.app.script_name may be an empty string (which happens when accessing a Wok tab and server_root is not defined). And that was leading to set a wrong last page cookie like "/#/tabs/settings.html" (with an extra /) that does not correspond to any tab content. That way, no matter on what Wok page was the last page visited, the user would be always redirected to the default one (which was the first Wok tab - because that the problem was not found befor= e). Signed-off-by: Aline Manera --- src/wok/root.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wok/root.py b/src/wok/root.py index 279ca7f..a0323f9 100644 --- a/src/wok/root.py +++ b/src/wok/root.py @@ -116,8 +116,8 @@ class Root(Resource): # template to save the delay of the extra get to the guest page # For that, the tab template needs to know the correct path to ui = files paths =3D cherrypy.request.app.root.paths - script_name =3D cherrypy.request.app.script_name - last_page =3D script_name.lstrip("/") + "/tabs/" + page[:-5] + script_name =3D cherrypy.request.app.script_name or "/" + last_page =3D os.path.join(script_name, "tabs/", page[:-5]).lstrip= ("/") =20 data =3D {} data['ui_dir'] =3D paths.ui_dir --=20 2.9.3 _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel