deprecate app session methods in favor of session_interface

ref #1182
This commit is contained in:
David Lord 2017-05-29 13:30:58 -07:00
parent abf54c8182
commit b9c8c9bad1
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 37 additions and 6 deletions

View file

@ -329,9 +329,11 @@ class RequestContext(object):
# available. This allows a custom open_session method to use the
# request context (e.g. code that access database information
# stored on `g` instead of the appcontext).
self.session = self.app.open_session(self.request)
session_interface = self.app.session_interface
self.session = session_interface.open_session(self.app, self.request)
if self.session is None:
self.session = self.app.make_null_session()
self.session = session_interface.make_null_session(self.app)
def pop(self, exc=_sentinel):
"""Pops the request context and unbinds it by doing that. This will