Opened 7 years ago

Closed 7 years ago

#7363 closed (duplicate)

Form wizard has a bug in get_template(self, step). The 'step' variable is always 0, it never gets incremented.

Reported by: Tyson Wenger <twenger2@…> Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


When I override this function below, the "step" variable always stays set to 0. It never gets
updated. Therefore only my template_0.html gets loaded. I want it to
continue down the line like template_0.html, template_1.html, ...and so on.

def get_template(self, step):

return 'vlis/production/order/template_%s.html' % step

Unless I am really mistaken and doing something wrong, I am pretty sure this is a bug. The
"self.step" variable in "" is never being updated after the
forms are submitted from one page to the next.

These are two possible fixes I found that might work:

  1. In the method "def call(self, request, *args, kwargs) :"

update the self.step variable after the is_valid() function is checked.


if form.is_valid():

if next_step == num:



form = self.get_form(next_step)
current_step = next_step
self.step = current_step #new code here

  1. In the method "def render_template(self, request, form, previous_fields, step, context=None):"

replace "self.step" with the functions "step" argument value instead.


return render_to_response(self.get_template(self.step),



return render_to_response(self.get_template(step),


If anyone can verify that they have the same problem, I will submit
this to a bug fix. Thanks.

Change History (1)

comment:1 Changed 7 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #6893

Note: See TracTickets for help on using tickets.
Back to Top