Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs handling Location #1297

Merged
merged 2 commits into from
Apr 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions panel/viewable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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._locations[root.document]

def _preprocess(self, root):
"""
Expand Down Expand Up @@ -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
Expand Down