mdipierro/web2py — Issue #8: KeyError'> '_id' in auth/profile
Author: rochacbruno
Created: 2012-01-25 07:53:30+00:00
State: open

My last pull from github introduced this error:

```python
Traceback (most recent call last):
File "/home/bruce/projects/web2py/gluon/restricted.py", line 204, in restricted
exec ccode in environment
File "/home/bruce/projects/web2py/applications/demo/controllers/person.py", line 131, in
File "/home/bruce/projects/web2py/gluon/globals.py", line 172, in
self._caller = lambda f: f()
File "/home/bruce/projects/web2py/applications/demo/controllers/person.py", line 85, in account
person = Person("account")
File "applications/demo/modules/handlers/base.py", line 30, in __init__
self.__getattribute__(hook)()
File "applications/demo/modules/handlers/person.py", line 411, in account
self.context.form = self.db.auth()
File "/home/bruce/projects/web2py/gluon/tools.py", line 1159, in __call__
return getattr(self,args[0])()
File "/home/bruce/projects/web2py/gluon/tools.py", line 2431, in profile
onvalidation=onvalidation, hideerror=self.settings.hideerror):
File "/home/bruce/projects/web2py/gluon/sqlhtml.py", line 1088, in accepts
hideerror=hideerror,
File "/home/bruce/projects/web2py/gluon/html.py", line 1807, in accepts
status = self._traverse(status,hideerror)
File "/home/bruce/projects/web2py/gluon/html.py", line 749, in _traverse
newstatus = c._traverse(status,hideerror) and newstatus
File "/home/bruce/projects/web2py/gluon/html.py", line 749, in _traverse
newstatus = c._traverse(status,hideerror) and newstatus
File "/home/bruce/projects/web2py/gluon/html.py", line 749, in _traverse
newstatus = c._traverse(status,hideerror) and newstatus
File "/home/bruce/projects/web2py/gluon/html.py", line 749, in _traverse
newstatus = c._traverse(status,hideerror) and newstatus
File "/home/bruce/projects/web2py/gluon/html.py", line 756, in _traverse
newstatus = self._validate()
File "/home/bruce/projects/web2py/gluon/html.py", line 1572, in _validate
(value, errors) = validator(value)
File "/home/bruce/projects/web2py/gluon/validators.py", line 549, in __call__
elif str(rows[0]._id) != str(self.record_id):
File "/home/bruce/projects/web2py/gluon/dal.py", line 5466, in __getattr__
return self[key]
File "/home/bruce/projects/web2py/gluon/dal.py", line 5457, in __getitem__
return dict.__getitem__(self, key)
KeyError: '_id'
```

# where it raises

* go to default/user/profile
* change something and try to save
* Note that I have some extra_fields in auth_user