Browse Source

If a session is not found , None is now returned instead of an empty dict

Roland Haroutiounian 8 years ago
parent
commit
fd153057df
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      lodel/auth/session.py

+ 2
- 2
lodel/auth/session.py View File

94
 
94
 
95
     ## @brief gets a session's content
95
     ## @brief gets a session's content
96
     # @param sid str : id of the session to read
96
     # @param sid str : id of the session to read
97
-    # @return dict
97
+    # @return dict | None if no valid session if found
98
     def get_session(self, sid):
98
     def get_session(self, sid):
99
         if self.is_session_existing(sid):
99
         if self.is_session_existing(sid):
100
             if not self.has_session_expired(sid):
100
             if not self.has_session_expired(sid):
101
                 session = self.read_session(sid)
101
                 session = self.read_session(sid)
102
             else:
102
             else:
103
                 self.delete_session(sid)
103
                 self.delete_session(sid)
104
-                session = {}
104
+                session = None
105
         else:
105
         else:
106
             raise AuthenticationError("No session file found for the sid %s" % sid)
106
             raise AuthenticationError("No session file found for the sid %s" % sid)
107
 
107
 

Loading…
Cancel
Save