Skip to content

Commit

Permalink
Store "rebar" in app.extensions on rebar.init_app (plangrid#230)
Browse files Browse the repository at this point in the history
Include handler_registries so that it's possible to enumerate all the
Rebar APIs a Flask app provides given only a reference to the app object.
  • Loading branch information
twosigmajab authored May 7, 2021
1 parent 7f7c225 commit 134c5ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flask_rebar/rebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,8 @@ def init_app(self, app):
for registry in self.handler_registries:
registry.register(app=app)

app.extensions["rebar"] = {"handler_registries": self.handler_registries}

def _init_error_handling(self, app):
@app.errorhandler(errors.HttpJsonError)
def handle_http_error(error):
Expand Down

0 comments on commit 134c5ab

Please sign in to comment.