Some forms need to be submitted multiple times.

74 views
Skip to first unread message

Ian W. Scott

unread,
Sep 18, 2013, 11:15:46 AM9/18/13
to web...@googlegroups.com
I'm experiencing an odd problem where some of my forms (including registration and login forms) need to be submitted 2 or 3 times before they are processed. It's been hard to solve because it doesn't seem entirely consistent. Has anyone run into this, and does anyone have any idea what the cause would be?

Thanks,

Ian

Massimo Di Pierro

unread,
Sep 18, 2013, 12:41:19 PM9/18/13
to web...@googlegroups.com
Which version?

Ian W. Scott

unread,
Sep 20, 2013, 4:26:39 PM9/20/13
to web...@googlegroups.com
Sorry for the slow response. I'm experiencing this with 2.6.3 but have also had the problem with the last couple of versions. It has been the kind of thing that I keep putting off debugging because I'm not sure where to start.

Could it have to do with the way I'm extending the auth_user table? In my db.py I have

auth = Auth(db, hmac_key=Auth.get_or_create_key())  # authent/authorization

#adding custom field for user time zone
auth
.settings.extra_fields['auth_user'] = [
   
Field('time_zone',
         
'string',
         
default='America/Toronto',
          requires
=IS_IN_SET((common_timezones)),
          widget
=SQLFORM.widgets.options.widget
         
)
]

Although I'm able to use the data from that field without any trouble.

Ian

Niphlod

unread,
Sep 20, 2013, 5:12:35 PM9/20/13
to web...@googlegroups.com
I can't replicate it .... but 1st thing to debug: remove that requires and replace with a requires=IS_IN_SET(('America/Toronto')) ...

BTW: "submitting 2 or 3 times" what means exactly? that you put email and password and you hit submit and you get back an error, the same login form, the login form empty, .... (fill the blanks :-P) ?

Ian W. Scott

unread,
Sep 21, 2013, 10:16:17 AM9/21/13
to web...@googlegroups.com
Thanks Niphlod. I submit the form and get back the same form, empty. It's as if the submitted data is just dumped and the page reloads as if nothing had been sent.

I'll try the replacement you suggest and get back to you.

Ian

Christian Foster Howes

unread,
Sep 22, 2013, 11:53:26 AM9/22/13
to web...@googlegroups.com
i have noticed that if in the same browser i open the same page with the same form in multiple tabs my stored session data only stores 1 form key, so the most recently loaded tab will submit the form fine, the others will be denied until i reload the page.  any chance you have form key duplication?  or are losing the form key somehow?

Massimo Di Pierro

unread,
Sep 22, 2013, 12:11:41 PM9/22/13
to web...@googlegroups.com
That is by design. Perhaps we should change it. The problem is how not to pollute the session with un-used keys.

Christian Foster Howes

unread,
Sep 22, 2013, 12:16:57 PM9/22/13
to web...@googlegroups.com, Massimo Di Pierro
and i don't mind the design at all....i can't think of a good reason
that a real user would be in this situation. i tend to break things
when testing or doing rote admin tasks (with my admin forms not web2py
admin)

cfh

szimszon

unread,
Sep 22, 2013, 1:31:17 PM9/22/13
to web...@googlegroups.com, Massimo Di Pierro
Hi!

I have some apps where I usually do multiple things simultaneously or I have to look at some page for information (page with form too) and copy&past to the first. But I have to reload the first page because the single form key. It can be really annoying :( So if it could be change I'm for the change. :-)

Massimo DiPierro

unread,
Sep 22, 2013, 1:33:22 PM9/22/13
to szimszon, web...@googlegroups.com
Please open a ticket. I have an idea about what to do.

szimszon

unread,
Sep 22, 2013, 1:51:05 PM9/22/13
to web...@googlegroups.com, szimszon
Reply all
Reply to author
Forward
0 new messages