Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass *args and **kwargs to render #97

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions formtools/wizard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def get(self, request, *args, **kwargs):

# reset the current step to the first step.
self.storage.current_step = self.steps.first
return self.render(self.get_form())
return self.render(form=self.get_form(), **kwargs)

def post(self, *args, **kwargs):
"""
Expand All @@ -278,7 +278,7 @@ def post(self, *args, **kwargs):
# form. (This makes stepping back a lot easier).
wizard_goto_step = self.request.POST.get('wizard_goto_step', None)
if wizard_goto_step and wizard_goto_step in self.get_form_list():
return self.render_goto_step(wizard_goto_step)
return self.render_goto_step(wizard_goto_step, **kwargs)

# Check if form was refreshed
management_form = ManagementForm(self.request.POST, prefix=self.prefix)
Expand Down Expand Up @@ -306,11 +306,11 @@ def post(self, *args, **kwargs):
# check if the current step is the last step
if self.steps.current == self.steps.last:
# no more steps, render done view
return self.render_done(form, **kwargs)
return self.render_done(form=form, **kwargs)
else:
# proceed to the next step
return self.render_next_step(form)
return self.render(form)
return self.render_next_step(form=form, **kwargs)
return self.render(form=form, **kwargs)

def render_next_step(self, form, **kwargs):
"""
Expand Down