I solved it this way:

    eventLogin = db(db.auth_event.user_id == auth.user.id).select()
    if len(eventLogin) == 1:
        session.flash= 'This is the first time you log in, please fill in
your profile'
        redirect(URL('default','user/profile'))
    #Obtain the row in audienceInstances table f

Thanks Bruno

On Tue, Jul 12, 2011 at 3:22 PM, Bruno Rocha <[email protected]> wrote:

> Auth has an auth_event which stores login events for users.
>
> You can make a count on event table to know if it is first time ligin.
>
> http://zerp.ly/rochacbruno
> Em 12/07/2011 11:57, "Nicolas Palumbo" <[email protected]> escreveu:
>
> > Any ideas on how to implement this?
> >
> > On Wed, Jul 6, 2011 at 7:13 PM, Nicolas Palumbo <[email protected]>
> wrote:
> >
> >> I'm currently using ldap to auth with ldap_auth module of web2py.
> >> Currently if you are successful to login, are automatically redirected
> >> to index page.
> >> Which happens the first time the user log in to the system as well.
> >> I'd like to detect if it is the first time for a user to log into the
> >> system and then redirect to profile edition.
> >> Any ideas?
> >>
> >> I was advised to to this:
> >> auth.settings.register_next = URL('defaul', 'user', args=['profile'])
> >> But is not working, I think is because users are not registering. They
> >> just log in.
> >>
> >> Thanks in advance,
> >> Nico
> >>
>

Reply via email to