Odd error using Formwizard

15 views
Skip to first unread message

Griffin Caprio

unread,
Apr 7, 2014, 3:30:09 PM4/7/14
to django...@googlegroups.com
Hi,

I have a form wizard view with 2 required forms & 1 optional form in it. I'm seeing an occasional error during submission. Here's my named forms:

DONATE_FORMS = [("donate", DonateFormItemInformation), ("delivery", DonateFormDeliveryMethod), ("about", DonateFormAbout)]

My URL entry:

login_required(DonateWizard.as_view(DONATE_FORMS, condition_dict=DONATE_CONDITION_DICT)),

My condition dictionary:

DONATE_CONDITION_DICT = {'about': show_donor_about_form}

Finally the condition itself:

def show_donor_about_form(wizard):
    return wizard.request.user.is_authenticated() and not wizard.request.user.has_donor_profile()

The error I'm getting is:

ValueError: u'about' is not in list 

The odd part is that the in the logs for this error, I'm seeing the form data for 'about'. So the user is getting to the form, entering data, & submitting it, then the error occurs. I can't reproduce this reliably. After digging into the django source, looks like the get_form_list method regenerates the form_list every step. So could the condition return true before the form is display, then suddenly return false after the form submission?

Any help is appreciated.

Thanks,
Griffin

Reply all
Reply to author
Forward
0 new messages