I get this error when trying to navigate to the change_password method
exposed by auth:

NameError: global name 'password_field' is not defined

This is my custom auth table:

from gluon.tools import *
auth=Auth(globals(),db)            # authentication/authorization
auth.settings.table_user = db.define_table("auth_user",
     db.Field("first_name", length=128,default=""),
     db.Field("last_name", length=128,default=""),
     db.Field('username',length=128,default=""),
     db.Field("email", length=128,default=""),
     db.Field("password", 'password',readable=False,
label="Password"),
     db.Field("registration_key", length=128,
              writable=False, readable=False, default=""))
t = auth.settings.table_user
t.first_name.requires = IS_NOT_EMPTY()
t.last_name.requires = IS_NOT_EMPTY()
t.password.requires = [IS_STRONG(upper=1,number=1,special=None),CRYPT
()]
t.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db, db.auth_user.email)]
t.username.requires = [IS_NOT_EMPTY(),IS_NOT_IN_DB(db,
db.auth_user.username)]

Here's the traceback:

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 107, in restricted
    exec ccode in environment
  File "C:/web2py/applications/web2pyslices/controllers/default.py",
line 94, in <module>
  File "C:\web2py\gluon\globals.py", line 100, in <lambda>
    self.menu = None  # used by the default view layout
  File "C:/web2py/applications/web2pyslices/controllers/default.py",
line 68, in user
    return dict(form=auth())
  File "C:\web2py\gluon\tools.py", line 457, in __call__
    redirect(self.url(args='login'))
  File "C:\web2py\gluon\tools.py", line 1083, in change_password
    )
NameError: global name 'password_field' is not defined

Any ideas what I am missing? I am running the latest trunk.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to