I believe this is a workflow issues. By storing the message in session and retrieving it in models, you probably always the display the previously set message and not the one you want. You must set the messages before you call crud update and not after.
Also if row is None, crud.update reverts to crud.create. you need to configure the messages On Saturday, 13 October 2012 01:20:42 UTC-5, Annet wrote: > > In a function I have the following lines of code: > > > form=crud.update(table=db.aboutText,record=row,next=session.crud_next,deletable=True) > setFlash(crud,response,session,row,'Home page') > > > ... in a module: > > def setFlash(crud,response,session,row,function): > session.record_updated=session.record_deleted=session.record_created='' > if row: > response.flash='%s' %function + ' wijzigen. De velden gemerkt met > een * zijn verplichte velden' > session.alert='alert-info' > session.record_updated='%s' %function + ' gewijzigd' > session.crud_alert='alert-success' > session.record_deleted='%s' %function + ' verwijderd' > else: > response.flash='%s' %function + ' toevoegen. De velden gemerkt > met een * zijn verplichte velden' > session.alert='alert-info' > session.record_created='%s' %function + ' toegevoegd' > session.crud_alert='alert-success' > > > .. and in a model file: > > if session.record_created: > crud.messages.record_created=session.record_created > if session.record_updated: > crud.messages.record_updated=session.record_updated > if session.record_deleted: > crud.messages.record_deleted=session.record_deleted > > > This works flawless except for the record_created message, instead of the > record created message I get the record updated message. > > I there an error in my code which I overlook? > > > Kind regards, > > Annet > > --

