Skip to content

Commit

Permalink
Improve documentation for bookstore's BookstoreVersionHandler methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpacer committed Jun 27, 2019
1 parent 9875a2c commit 1489aec
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion bookstore/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,34 @@ class BookstoreVersionHandler(APIHandler):
"""Handler responsible for Bookstore version information
Used to lay foundations for the bookstore package. Though, frontends can use this endpoint for feature detection.
Methods
-------
get(self)
Provides version info and feature availability based on serverside settings.
build_response_dict(self)
Helper to populate response.
"""

@web.authenticated
def get(self):
"""GET /api/bookstore/
Returns version info and validation info for various bookstore features.
"""
self.finish(json.dumps(self.build_response_dict()))

def build_response_dict(self):
"""Helper for building the version handler's response before serialization."""
return {
"bookstore": True,
"bookstore": True, # TODO: Should we remove this; isn't it equivalent to the endpoint responding?
"version": self.settings['bookstore']["version"],
"validation": self.settings['bookstore']["validation"],
}


def build_settings_dict(validation):
"""Helper for building the settings info that will be assigned to the web_app."""
return {"version": version, "validation": validation}


Expand Down

0 comments on commit 1489aec

Please sign in to comment.