Error on gluon.tools register

31 views
Skip to first unread message

Rafael Acorsi

unread,
Oct 11, 2013, 12:30:03 PM10/11/13
to web2py-d...@googlegroups.com
Hello friends, I found a problem in lib gluon.tools more precisely in the register method, where the username does not get the custom field, sending down the track.

Line 2229 on gluon.tools

def register(
        self,
        next=DEFAULT,
        onvalidation=DEFAULT,
        onaccept=DEFAULT,
        log=DEFAULT,
    ):
        """
        returns a registration form

        method: Auth.register([next=DEFAULT [, onvalidation=DEFAULT
            [, onaccept=DEFAULT [, log=DEFAULT]]]])

        """

        table_user = self.table_user()
        request = current.request
        response = current.response
        session = current.session
        if self.is_logged_in():
            redirect(self.settings.logged_url, client_side=True)
        if next is DEFAULT:
            next = self.next or self.settings.register_next
        if onvalidation is DEFAULT:
            onvalidation = self.settings.register_onvalidation
        if onaccept is DEFAULT:
            onaccept = self.settings.register_onaccept
        if log is DEFAULT:
            log = self.messages.register_log

        table_user = self.table_user()
        # correction:
        if self.settings.login_userfield:
            username = self.settings.login_userfield
        elif 'username' in table_user.fields:
            username = 'username'
        else:
            username = 'email'
....


Sorry if it is not the correct place, but I hope I helped!

Massimo DiPierro

unread,
Oct 13, 2013, 10:18:44 PM10/13/13
to web2py-d...@googlegroups.com
My code looks exactly like yours. Perhaps you have an older version?

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Rafael Acorsi

unread,
Oct 14, 2013, 2:50:01 PM10/14/13
to web2py-d...@googlegroups.com
It exatemente it can close the topic, the latest version already fixed.
Thanks and sorry for the delay;
Reply all
Reply to author
Forward
0 new messages