and you do not need db.commit() since on success that is automatic.

Massimo

On Nov 25, 12:01 am, mdipierro <[EMAIL PROTECTED]> wrote:
>             id=db.users.update(
>                                email        = form.vars.email,
>                                password     = form.vars.password
>                                )
>
> should be
>
>             id=db.users.insert(
>                                email        = form.vars.email,
>                                password     = form.vars.password
>                                )
>
> else you are updating the db.users dictionary thus redefining the
> meaning of field email and field password.
>
> Massimo
>
> On Nov 24, 11:18 pm, voltron <[EMAIL PROTECTED]> wrote:
>
> > I am using:
>
> > Version 1.51 (2008-11-19 14:48:02)
> > Database drivers available: SQLite3, Postgre
>
> > The only code that could be of use is this snippet, the rest are
> > several lines of forms, strings, mail templates and such
>
> > user = db(db.users.id == session.user_id).select()
>
> > if form.accepts(request.vars,session,
> > formname="account_management_form") and
> > form.vars.password==form.vars.password2:
> >         key = md5.new(str(random.randint(0,9999))).hexdigest()
> >         try:
> >             id=db.users.update(
> >                                email        = form.vars.email,
> >                                password     = form.vars.password
> >                                )
>
> >         except Exception, detail:
> >             print 'Error:', detail
> >             response.flash = T("Update unsuccessful, please contact
> > our service team")
> >         else:
> >             db.commit()
> >             session.flash = user[0].user_name
> >             redirect(URL(r=request, f="manage_account"))
> >     elif form.vars.password != form.vars.password2:
> >         form.errors.password2 = T('Passwords do not match')
> >         response.flash = T("Update unsuccessful, please contact our
> > service team")
> >     elif form.errors:
> >         response.flash = T("Please check your values")
> >     else:
> >         pass
> >         #response.flash = T("Please fill in the registration form")
>
> >     return dict(form = form, page_title = page_title, page_content =
> > page_content)
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to