I have the following function:
def update():
myset=db((db.nodeNav.nodeID==id)&(db.nodeNav.navID==db.nav.id)&(db.nav.navbarID==navbarID)&(db.nodeNav.navID!=navID))
rows=myset.select(orderby=db.nodeNav.id)
fields_list=[]
for r in rows:
field='f' + str(r.nav.id)
fields_list.append(Field(field,type='boolean',default=r.nodeNav.frontend,
label=str(r.nav.name).replace('_',' ').capitalize()))
form=SQLFORM.factory(*fields_list,separator='')
if form.process().accepted:
rows=sets.select(db.nodeNav.ALL,orderby=db.nodeNav.navID)
response.flash=''
for r in rows:
field='f' + str(r.navID)
response.flash=response.flash + ' ' + str(field) + ' ' +
str(form.vars[field])
if auth.has_membership(ADMIN):
r.update_record(backend=form.vars[field])
else:
r.update_record(frontend=form.vars[field])
form=None
redirect(URL('index'))
elif form.errors:
response.flash=response_flash('formerror',session)
elif not response.flash:
response.flash='Check the desired functionality'
return dict(form=form)
After upgrading to web2py 2.4.6 the redirect prevents the form form being
processed, when I remove the redirect the form is processed correctly,
however,
users end up on the same page, which is not what I want.
if form.process(next=URL('index')).accepted:
behaves the same.
Why does the redirect prevent the form from being processed?
Annet
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.