So no answers were given and I tried to fix FormWizard class.
The patch is attached and the only thing changed is that the revalidation is
made with forms which  were before the last one (I do not see any reason for
the second validation of it).
Is there any chance to get it into the trunk?
Do I need to make any additional steps for this to happen?

Kirill.

On 8 апр, 22:29, qrilka <qri...@gmail.com> wrote:
> I've stumbled upon from revalidation in form wizard. The similar
> problem was discussed a year ago -
http://groups.google.com/group/django-users/browse_thread/thread/a6fd...
> I have somewhat different problem: on the last of my forms I use
> captcha field, but after successful validation the test string for it
> gets erased (either in cache in supercaptcha or in DB in django-simple-
> captcha) and its quite normal from my point of view. But form wizard
> does form revalidation at the end so I get validation error.
> The only solution I see now (except from not using from wizard) is to
> hack captcha field and not to delete test string after success.But
> this option lokks somewhat nasty to me.
> Maybe there are some other ways around?
>
> Best regards,Kirill.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Index: django/contrib/formtools/wizard.py
===================================================================
--- django/contrib/formtools/wizard.py	(revision 9975)
+++ django/contrib/formtools/wizard.py	(working copy)
@@ -76,19 +76,19 @@
             self.process_step(request, form, current_step)
             next_step = current_step + 1
 
-            # If this was the last step, validate all of the forms one more
+            # If this was the last step, validate all of the previous forms one more
             # time, as a sanity check, and call done().
             num = self.num_steps()
             if next_step == num:
-                final_form_list = [self.get_form(i, request.POST) for i in range(num)]
+                prior_form_list = [self.get_form(i, request.POST) for i in range(num - 1)]
 
                 # Validate all the forms. If any of them fail validation, that
                 # must mean the validator relied on some other input, such as
                 # an external Web site.
-                for i, f in enumerate(final_form_list):
+                for i, f in enumerate(prior_form_list):
                     if not f.is_valid():
                         return self.render_revalidation_failure(request, i, f)
-                return self.done(request, final_form_list)
+                return self.done(request, prior_form_list+[form])
 
             # Otherwise, move along to the next step.
             else:

Reply via email to