[Answer]-Django: how do i request username in SessionWizardView?

1👍

You could just do this:

class ContactWizard(SessionWizardView):
    template_name = "invite.html"

    def done(self, form_list, **kwargs):
        form_data = process_form_data(form_list, self.request.user)

        return render_to_response('invitedone.html', {'form_data': form_data})

And do not forget to require the login for the wizard view as well.

Anyway as @Daniel Roseman said you may also want to rethink your design and make the process_form_data part of the view.

Leave a comment