Skip to content
Browse files

Fixed SessionMixin bug that caused a recursion error

  • Loading branch information...
1 parent c0c3c9f commit 5c1f42a7aa9e0f125abde14b4fbcdd273bbd361b @LBiNationalTrust LBiNationalTrust committed
Showing with 8 additions and 6 deletions.
  1. +1 −1 Documentation/index.rst
  2. +2 −2 Mojo/Auth/Mixins/SessionMixins.py
  3. +4 −2 Mojo/Auth/SessionManager.py
  4. +1 −1 README.rst
View
2 Documentation/index.rst
@@ -3,7 +3,7 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-Mojo v0.1.2 - a framework for Tornado
+Mojo v0.1.3 - a framework for Tornado
=====================================
Mojo is a framework that makes it easy and quick to build Tornado projects that scale.
View
4 Mojo/Auth/Mixins/SessionMixins.py
@@ -92,8 +92,7 @@ def create_new_session(self):
Wrapper around the SessionManagers _create_new_session() method, but will save the session to DB instead of
having to manage it manually.
"""
- new_session_model = self.session._create_new_session()
- self.session.session_model = new_session_model
+ self.session._create_new_session()
self.save_session_object()
def save_session_object(self):
@@ -103,6 +102,7 @@ def save_session_object(self):
"""
if self.session.session_model is not None:
self.session.session_model.save()
+
else:
self.create_new_session()
View
6 Mojo/Auth/SessionManager.py
@@ -148,14 +148,16 @@ def _encode_session(self, session_data):
return encoded_str
- def _create_new_session(self, callback):
+ def _create_new_session(self, callback = None):
'''
Creates and sets up a new ``session_model`` ready for the request.
'''
new_session = Setup_session(Session())
self.session_model = new_session
self.request_handler.set_secure_cookie('session_id', new_session.session_key)
- callback(self.session_model)
+ if callback:
+ callback(self.session_model)
+
def Setup_session(sessionObj, expiry_days=30, expiry_hours=0, expiry_minutes=0):
'''
View
2 README.rst
@@ -1,4 +1,4 @@
-Mojo v0.1.2 - a framework for Tornado
+Mojo v0.1.3 - a framework for Tornado
=====================================
Mojo is a framework that makes it easy and quick to build Tornado projects that scale.

0 comments on commit 5c1f42a

Please sign in to comment.
Something went wrong with that request. Please try again.