timsavage / django-ajax-forms

Automatically exported from code.google.com/p/django-ajax-forms
Other
1 stars 1 forks source link

Forms with prefixes produce broken equal_to_field rules in JSON if reloaded #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a form with a prefix; I noticed this in a form wizard.
2. Reload the page containing the form a few times, checking the JSON rendered 
for the form validation.
3. Each time the page is reloaded, the prefix is prepended to the 
equal_to_field rule's target field name.

This is probably only an issue in production environments where the form class 
is not being reloaded on each request. I believe what's happening in 
utils.form_to_json is that the Ajax inner class of the form is having its rules 
changed when the form is rendered.

This patch seems to fix it for me.

Original issue reported on code.google.com by fairview...@gmail.com on 8 Jul 2010 at 12:51

Attachments:

GoogleCodeExporter commented 9 years ago
Verified this issue in "example2" of base distro.  The above fix does indeed 
appear to work.

Original comment by semilegitimate@gmail.com on 11 Nov 2010 at 2:36

GoogleCodeExporter commented 9 years ago

Original comment by Sle...@gmail.com on 20 Jan 2012 at 2:23

GoogleCodeExporter commented 9 years ago

Original comment by Sle...@gmail.com on 20 Jan 2012 at 3:26