it's not that i 've corrected but not htat it drives me crazy it worked
yesterday :
def invitation():
form=FORM("Code Invitation :", INPUT(_name='invitation'),"<Email
:",INPUT(_name='email'), INPUT(_type='submit'))
if form.process(onvalidation=verif_invitation).accepted and
form.vars.invitation != None :
email = form.vars.email
if db(db.auth_user.email == email).count() == 0:
password= form.vars.invitation
my_crypt = CRYPT(key=auth.settings.hmac_key)
crypt_pass = my_crypt(password)[0]
db.auth_user.insert(
email= email,
username="John_Doe",
password=crypt_pass,
invitation = form.vars.invitation,
)
db.commit()
# here is the bug :
user = db(db.auth_user.email==email).select().first()
session.auth = Storage(user=user, last_visit=request.now,
expiration=auth.settings.expiration)
redirect(URL('inscriptioninvit'))
here is the bug :
TICKET ID
127.0.0.1.2012-04-04.15-36-46.150d92e6-038c-41c3-8d0a-f9e7997f3daa
<type 'exceptions.KeyError'> 'User'VERSIONweb2py™(1, 99, 7,
datetime.datetime(2012, 3, 4, 22, 12, 8), 'stable')PythonPython 2.5.4:
C:\Users\Bussiere\Dropbox\Projets\jackpoint\web2py\web2py.exeTRACEBACK
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
Traceback (most recent call last):
File "gluon/restricted.py", line 205, in restricted
File
"C:/Users/Bussiere/Dropbox/Projets/jackpoint/web2py/applications/init/controllers/default.py"
<http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py>, line
748, in <module>
File "gluon/globals.py", line 173, in <lambda>
File
"C:/Users/Bussiere/Dropbox/Projets/jackpoint/web2py/applications/init/controllers/default.py"
<http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py>, line
685, in invitation
File "gluon/dal.py", line 7578, in select
File "gluon/dal.py", line 1320, in select
File "gluon/dal.py", line 1624, in parse
File "gluon/dal.py", line 6714, in __getitem__
KeyError: 'User'
ERROR SNAPSHOT [image: help]
<type 'exceptions.KeyError'>('User')
inspect attributes
Frames
-
*File
C:\Users\Bussiere\Dropbox\Projets\jackpoint\web2py\gluon\restricted.py in
restricted at line 205* code arguments variables
-
*File
C:\Users\Bussiere\Dropbox\Projets\jackpoint\web2py\applications\init\controllers\default.py
in <module> at line 748* code arguments variables
-
*File
C:\Users\Bussiere\Dropbox\Projets\jackpoint\web2py\gluon\globals.py in
<lambda> at line 173* code arguments variables
-
*File
C:\Users\Bussiere\Dropbox\Projets\jackpoint\web2py\applications\init\controllers\default.py
in invitation at line 685* code arguments variables
-
*File C:\Users\Bussiere\Dropbox\Projets\jackpoint\web2py\gluon\dal.py in
select at line 7578* code arguments variables
-
*File C:\Users\Bussiere\Dropbox\Projets\jackpoint\web2py\gluon\dal.py in
select at line 1320* code arguments variables
-
*File C:\Users\Bussiere\Dropbox\Projets\jackpoint\web2py\gluon\dal.py in
parse at line 1624* code arguments variables
-
*File C:\Users\Bussiere\Dropbox\Projets\jackpoint\web2py\gluon\dal.py in
__getitem__ at line 6714* code arguments variables
Function argument list
(self=<Table {'_db': <DAL {'auth_event': <Table {'orig..., '_id':
<gluon.dal.Field object at 0x0422C770>}>, key='User')
Code listing