Skip to content

Commit

Permalink
change jinja2_env key from nbserver settings. changed in nbclassic ju…
Browse files Browse the repository at this point in the history
…pyterhub#77 to avoid clashing with jupyter_server.

see jupyter/nbclassic#77 for history
  • Loading branch information
Austin Raney committed Jan 13, 2022
1 parent 6736008 commit 88ce236
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nbfetch/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from notebook.utils import url_path_join
import pickle

JINJA2_ENV_KEY = "notebook_jinja2_env"

class HSLoginHandler(IPythonHandler):
@gen.coroutine
def get(self):
Expand Down Expand Up @@ -232,7 +234,7 @@ def initialize(self):
# FIXME: Is this really the best way to use jinja2 here?
# I can't seem to get the jinja2 env in the base handler to
# actually load templates from arbitrary paths ugh.
jinja2_env = self.settings['jinja2_env']
jinja2_env = self.settings[JINJA2_ENV_KEY]
jinja2_env.loader = jinja2.ChoiceLoader([
jinja2_env.loader,
jinja2.FileSystemLoader(
Expand Down Expand Up @@ -275,7 +277,7 @@ def get(self):
class HSHandler(IPythonHandler):
def initialize(self):
super().initialize()
jinja2_env = self.settings['jinja2_env']
jinja2_env = self.settings[JINJA2_ENV_KEY]
jinja2_env.loader = jinja2.ChoiceLoader([
jinja2_env.loader,
jinja2.FileSystemLoader(
Expand Down

0 comments on commit 88ce236

Please sign in to comment.