Hi,
since I doesn't need any email adresses associated with my users, I
changed the schema of the auth_user table like this:

file: db.py

<snip>
db.define_table(
    auth.settings.table_user_name,
    Field('name', length=32, default='', label='Name'),
    Field('password', 'password', length=512, readable=False,
label='Passwort'),
    Field('registration_key', length=512, writable=False,
readable=False, default=''),
    Field('reset_password_key', length=512, writable=False,
readable=False, default=''),
    Field('registration_id', length=512, writable=False,
readable=False, default=''))

custom_auth_table = db[auth.settings.table_user_name]
custom_auth_table.name.requires =
[IS_NOT_EMPTY(error_message=auth.messages.is_empty),
                                   IS_NOT_IN_DB(db,
custom_auth_table.name)]
custom_auth_table.password.requires =
CRYPT(key=auth.settings.hmac_key)

auth.settings.table_user = custom_auth_table

auth.define_tables(username=True)
</snap>

I also managed to get the registration form working. However, if I try
to show the login form (http://localhost:8000/myapp/default/user/
login) I get the following error: KeyError: 'email'

It seems as web2py tries to generate the login form based on the
original auth_user schema. How can I change this? I didn't find
anything.

Please forgive me if this is a fiddling question - I'm still very new
to python and web2py.

Regards,
haggis

Reply via email to