Re: [web2py] Re: Temporary changing default values of a Form

2011-07-07 Thread Luis Goncalves
Done! Thank you!!! Luis. On Thu, Jul 7, 2011 at 6:24 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Please open a ticket in google code. If this is a web2py but will fix > asap. > > On Jul 6, 11:24 pm, Luis Goncalves wrote: > > In fact, just to make sure there wasn't something hi

[web2py] Re: Temporary changing default values of a Form

2011-07-07 Thread Massimo Di Pierro
Please open a ticket in google code. If this is a web2py but will fix asap. On Jul 6, 11:24 pm, Luis Goncalves wrote: > In fact, just to make sure there wasn't something hidden in my app affecting > the behavior, > I downloaded a fresh install of web2py, > > and get the same error: > >   File "/h

Re: [web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
In fact, just to make sure there wasn't something hidden in my app affecting the behavior, I downloaded a fresh install of web2py, and get the same error: File "/home/pierluigi/web2py/gluon/tools.py", line 1796, in register user = self.db(table_user[username] == form.vars[username]).select

Re: [web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
Yes, when I click on the invite and go to the website I get the registration form filled out with email (and name (excluded from my shortened example)) visible and non-editable. Luis. —«sent by mobile»— On Jul 6, 2011 8:17 PM, "Massimo Di Pierro" wrote: > Are you sure your db.registrant has an e

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Massimo Di Pierro
Are you sure your db.registrant has an email? On Jul 6, 10:04 pm, Luis Goncalves wrote: > I still get the same error: > >   File "/home/ubuntu/web2py/gluon/tools.py", line 1683, in register >     user = self.db(table_user[username] == > form.vars[username]).select().first() > KeyError: 'email' >

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
I still get the same error: File "/home/ubuntu/web2py/gluon/tools.py", line 1683, in register user = self.db(table_user[username] == form.vars[username]).select().first() KeyError: 'email' I don't know if it makes a difference or not, but I'm using emails for login (not a username) -- as

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Massimo Di Pierro
My example did not have the line: form=auth.register() On Jul 6, 1:39 pm, Luis Goncalves wrote: > Both with Massimo's > >           auth.settings.table_user.email.default = registrant.email >           auth.settings.table_user.email.writable=False > >           form=auth.register() > > and with

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
Actually, I still want email verification to happen (because someone else may stumble upon the link and register with a password unknown to the real user). Nevertheless, I disabled registration verification, and now I get an error deep within gloun/tools.py Error occurs after entering passwor

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Anthony
Do you have: auth.settings.registration_requires_verification = True somewhere? If so, remove that line or set it to False. That attempts to send a verification email to the user's email address (which is failing and causing the error), which I assume you don't need given that your registrat

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
Both with Massimo's auth.settings.table_user.email.default = registrant.email auth.settings.table_user.email.writable=False form=auth.register() and with your db[auth.settings.table_user_name].email.writable=False db[auth.settings.t

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Anthony
On Wednesday, July 6, 2011 2:04:26 PM UTC-4, Luis Goncalves wrote: > > db.table_user.email.writable=False # gives error > I think this should be db.auth_user, not db.table_user. Note, the name of the auth user table (which defaults to 'auth_user') is stored in auth.settings.table_use

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Massimo Di Pierro
This should do it: def user(): if request.args(0)=='register': registrant = db(db.registrant.token == request.vars.token).select().first() or redirect(URL('error')) db.auth_user.email.writable=False # gives error db.auth_user.email.default=registrant.email

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Luis Goncalves
Good point! Unfortunately, I am not expert enough to understand how to do this in my case, because I am using the form=auth.register(). Wouldn't I have to do what you suggest inside Auth.register ? (for an explanation of why I am doing this, see: https://groups.google.com/forum/#!topic/web2p

[web2py] Re: Temporary changing default values of a Form

2011-07-06 Thread Massimo Di Pierro
You would suggest you do this instead db.table.email.writable=False in the controller, before defining the form. Setting the field readonly in the view may still allow a malicious attacker to tamper with the field value. On Jul 6, 1:12 am, Luis Goncalves wrote: > I found the answer searching t

Re: [web2py] Re: Temporary changing default values of a Form

2011-07-05 Thread Luis Goncalves
Yes, I am trying to create an 'invitation' only registration, where the person receives an email with a link (and identifying token), and on my website I use the token to pre-populate the registration form, so that the user only has to pick his password. thx, Luis. On Tue, Jul 5, 2011 at 10:20 AM

[web2py] Re: Temporary changing default values of a Form

2011-07-05 Thread Massimo Di Pierro
Can you explain the logic? Are you trying to override whatever emails is typed in by the user on registration? On Jul 5, 12:08 pm, Luis Goncalves wrote: > This doesn't seem to work with auth() forms: > > form = auth.register() > > form.vars.email = 'l...@vision.caltech.edu' > > return dict(form=f

[web2py] Re: Temporary changing default values of a Form

2011-01-04 Thread mdipierro
Excellent question: db.mytable.myfield.default = request.args(0) form = SQLFORM(db.mytable) On Jan 4, 4:28 pm, Fabiano - deStilaDo wrote: > Hi, > > I have a default value for a field defined on the table definition, > along with its validators. > > I want to create a form with a different initi