Skip to content

Commit

Permalink
Add SUPPORTED_METHODS class attributes, bring closer to previous code…
Browse files Browse the repository at this point in the history
…base
  • Loading branch information
mpacer committed Oct 6, 2017
1 parent 93d0c4e commit deaac69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion notebook/nbconvert/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ def get_exporter(format, **kwargs):
raise web.HTTPError(500, "Could not construct Exporter: %s" % e)

class NbconvertFileHandler(IPythonHandler):
SUPPORTED_METHODS = ('GET',)

@web.authenticated
def get(self, format, path):
exporter = get_exporter(format, log=self.log)
exporter = get_exporter(format, config=self.config, log=self.log)
path = path.strip('/')
model = self.contents_manager.get(path=path)
model_content = model['content']
Expand Down Expand Up @@ -125,6 +126,7 @@ def get(self, format, path):


class NbconvertServiceHandler(IPythonHandler):
SUPPORTED_METHODS = ('POST',)

@web.authenticated
def post(self):
Expand Down

0 comments on commit deaac69

Please sign in to comment.