Try commenting out the line 'custom_auth_table.accountID.requires...' If that doesn't give you any progress, post all your auth model. I'm sure someone should be able to spot something obvious -- these bugs can be right under our noses sometimes :) -D
On Feb 12, 11:03 pm, Oskari <[email protected]> wrote: > Thank you for your answer villas! > > I don't think that is the problem. I am able to make inserts through > the appadmin-site, but somehow it fails with form.accepts(). > I also tried what you suggested, but could not quite get it working. > > On Feb 12, 8:45 pm, villas <[email protected]> wrote: > > > Not sure, but the 3rd attrib of 'IS_IN_DB' doesn't look right? > > > Maybe if you tried something like this, e.g. > > custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,'% > > (name)s') > > > On Feb 12, 1:28 pm, Oskari <[email protected]> wrote: > > > > Hi! > > > > I'm having trouble making an insert with form.accepts() > > > > Currently I have a custom auth_user that has one extra field: > > > Field('accountID', db.accounts) with > > > custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,id) > > > > While trying to modify variables it fails with "not found in db" > > > > def func(): > > > form=SQLFORM(db.auth_user) > > > request.vars.accountID = 1 > > > if form.accepts(request.vars,session): > > > response.flash = "Succesfully created user" > > > return dict(form=form) > > > > Why does not form.accepts() recognize and accept my accountID? > >

