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 password and submitting the form.
(same error with your and Massimo's version of the solution):

  File "/home/ubuntu/web2py/gluon/tools.py", line 1683, in register
    user = self.db(table_user[username] == form.vars[username]).select().first()
KeyError: 'email'

Maybe making table_user.email.writable=False  
prevents auth.register() from creating a new table entry for the new user???

Again, for reference, the (essential) code:

  def user():
  
      if request.args(0)=='register':
  
          registrant = db( db.registrant.token == request.vars.token 
).select().first()
    
          auth.settings.registration_requires_verification = False
  
          db[auth.settings.table_user_name].email.writable=False
          db[auth.settings.table_user_name].email.default=registrant.email

          # this causes same error
          # auth.settings.table_user.email.default = registrant.email
          # auth.settings.table_user.email.writable=False

          
          form=auth.register()
  
          return dict(form=form)                 

return dict(form=auth())

Reply via email to