Пример #1
0
def load_user(user_id):
    """
    We need to provide a :meth:`~flask.ext.login.LoginManager.user_loader` callback to the login manager.
    This callback is used to reload the user object from the user ID stored in the session.

    It should return `None` (**not raise an exception**) if the ID is not valid.
    (In that case, the ID will manually be removed from the session and processing
    will continue.)

    This is done by calling :meth:`~base.models.User.get_by_id`)
    ,
    :param user_id: the unicode ID of a user
    :return:the corresponding user object
    """
    return User.get_by_id(user_id)
Пример #2
0
def load_user(user_id):
    """
    We need to provide a :meth:`~flask.ext.login.LoginManager.user_loader` callback to the login manager.
    This callback is used to reload the user object from the user ID stored in the session.

    It should return `None` (**not raise an exception**) if the ID is not valid.
    (In that case, the ID will manually be removed from the session and processing
    will continue.)

    This is done by calling :meth:`~base.models.User.get_by_id`)
    ,
    :param user_id: the unicode ID of a user
    :return:the corresponding user object
    """
    return User.get_by_id(user_id)
Пример #3
0
def load_user(user_id):
    return User.get_by_id(user_id)
Пример #4
0
def load_user(user_id):
    return User.get_by_id(user_id)