From 067e90ae6b6911939cbf862f4a384f0d217ee82b Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Fri, 24 Apr 2020 02:55:06 +0200 Subject: [PATCH 1/2] Fix bugs handling Location --- panel/viewable.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panel/viewable.py b/panel/viewable.py index 25be3fe079..1d774d9b8c 100644 --- a/panel/viewable.py +++ b/panel/viewable.py @@ -399,6 +399,8 @@ def _cleanup(self, root): """ if root.ref['id'] in state._handles: del state._handles[root.ref['id']] + if root.document in state._locations: + del state._handles[root.document] def _preprocess(self, root): """ @@ -708,8 +710,8 @@ def server_doc(self, doc=None, title=None, location=True): if location: if isinstance(location, Location): loc = location - elif doc in state._locations: - loc = state.location + elif state._locations.get(doc) is not None: + loc = state._locations[doc] else: loc = Location() state._locations[doc] = loc From fede4bc6ce7c87e79f6921e8921aea023a742b42 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Fri, 24 Apr 2020 03:01:20 +0200 Subject: [PATCH 2/2] Update panel/viewable.py --- panel/viewable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/viewable.py b/panel/viewable.py index 1d774d9b8c..0d3228e4e0 100644 --- a/panel/viewable.py +++ b/panel/viewable.py @@ -400,7 +400,7 @@ def _cleanup(self, root): if root.ref['id'] in state._handles: del state._handles[root.ref['id']] if root.document in state._locations: - del state._handles[root.document] + del state._locations[root.document] def _preprocess(self, root): """