Hi
I've created a custom auth table to hide unwanted fields, and add
validators in the db.py file to better manage the registration process. As
part of this, within the db.py, I also include lines to *not* require
verification or approval. When I use .../default/user/register this
feature works just as expected.
However, when I call the form, in default.py using:
form=auth.register()
It appears as I need to when embed {{=form}} into the view. However, once
the registration is complete it is still requiring verification. How can I
get requires_verification = False to apply to my embedded form as well?
Below, I pasted the table definition and related settings, in db.py
(note, I also tried changing the settings with the custom table name, and
this did not work).
On a related note, I did try to avoid creating a custom auth table, and
just add some extra fields to the existing one. But I could not get any
validators to work to be ale to "hide" the required fields that I don't
want that are part of auth, nor to be able to modify the other features I
wanted.
Thanks for any help
---
db.define_table(
auth.settings.table_user_name,
Field('first_name', length=128, default='', writable=False,
readable=False),
Field('last_name', length=128, default='', writable=False,
readable=False, ),
Field('username', label=T('Username'), length=128, default='',
unique=True),
Field('email', length=128, writable=False, readable=False), # required
Field('password', 'password', length=512, # required
readable=False, label=T('Password')),
Field('token', label=T('Invite Code'), length=128, default=''),
Field('new_status', type='boolean', writable=False, readable=False),
Field('registration_key', length=512, # required
writable=False, readable=False, default=''),
Field('reset_password_key', length=512, # required
writable=False, readable=False, default=''),
Field('registration_id', length=512, # required
writable=False, readable=False, default=''))
custom_auth_table = db[auth.settings.table_user_name] # get the
custom_auth_table
auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = False
auth.settings.login_after_registration = True
auth.settings.login_next = URL('appname', 'accounts', 'index')
auth.settings.register_next = URL('appname', 'accounts', 'index')
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.