invenio_migrator/legacy/users.py
def _get_users_invenio12(*args, **kwargs):
    """Get user accounts Invenio 1."""
    from invenio.dbquery import run_sql, deserialize_via_marshal
    User = namedtuple('User', [
        'id', 'email', 'password', 'password_salt', 'note', 'full_name',
        'settings', 'nickname', 'last_login'
    ])
    users = run_sql(
        'SELECT id, email, password, note, settings, nickname, last_login'
        ' FROM user',
        run_on_slave=True)
    return len(users), [
        User(
            id=user[0],
            email=user[1],
            password=user[2].decode('latin1'),
            password_salt=user[1],
            note=user[3],
            full_name=user[5],
            settings=deserialize_via_marshal(user[4]) if user[4] else {},
            # we don't have proper nicknames on Invenio v1
            nickname='id_{0}'.format(user[0]),
            last_login=user[6]) for user in users
    ]
def _get_users_invenio12(*args, **kwargs):
    """Get user accounts Invenio 1."""
    from invenio.dbquery import run_sql, deserialize_via_marshal
    User = namedtuple('User', [
        'id', 'email', 'password', 'password_salt', 'note', 'full_name',
        'settings', 'nickname', 'last_login'
    ])
    users = run_sql(
        'SELECT id, email, password, note, settings, nickname, last_login'
        ' FROM user',
        run_on_slave=True)
    return len(users), [
        User(
            id=user[0],
            email=user[1],
            password=user[2].decode('latin1'),
            password_salt=user[1],
            note=user[3],
            full_name=user[5],
            settings=deserialize_via_marshal(user[4]) if user[4] else {},
            # we don't have proper nicknames on Invenio v1
            nickname='id_{0}'.format(user[0]),
            last_login=user[6]) for user in users
    ]
Get user accounts Invenio 1.