Пример #1
0
 def find_user(cls, session_id):
     s = cls.one(session_id=session_id)
     if s is None or s.expired():
         return User.guest()
     else:
         u = User.one(id=s.user_id)
         if u is None:
             return User.guest()
         else:
             return u
Пример #2
0
 def user(self):
     u = User.one(id=self.user_id)
     return u