Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#22372 closed Cleanup/optimization (fixed)

Incorrect docstring in wizard views

Reported by: simon29 Owned by: vlal
Component: Forms Version: 1.6
Severity: Normal Keywords:
Cc: vlal Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

In formtools.wizard.views.get_context_data, the docstring states the "wizard instance itself" is available in the template, but this is not correct.

The context includes a variable "wizard", but it is not the instance (as you would expect). This is confusing and dumb. Either the code should be changed (preferred, unless there is some paranoid security concern I'm not considering); or the docstring fixed and docs updated.

Change History (5)

comment:1 Changed 15 months ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 15 months ago by vlal

  • Cc vlal added
  • Has patch set
  • Owner changed from nobody to vlal
  • Status changed from new to assigned

Also it seems the form instance is actually included as part of the wizard key.

        context['wizard'] = {
            'form': form,
            'steps': self.steps,
            'management_form': ManagementForm(prefix=self.prefix, initial={
                'current_step': self.steps.current,
            }),
        }

It would be easier to modify the docstring and docs to reflect this rather than modify the code and potentially break many things.

Issued Pull Request #2505. Verified documentation builds correctly.

comment:3 Changed 15 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In a8e2ec0e82aaebfa53a8074581b22849896537df:

Fixed #22372 -- Improved description of WizardView.get_context_data().

Thanks simon29 for the report.

comment:4 Changed 15 months ago by Tim Graham <timograham@…>

In 28a686a0b75e118a4a24462f3b3d31c8231f010a:

[1.7.x] Fixed #22372 -- Improved description of WizardView.get_context_data().

Thanks simon29 for the report.

Backport of a8e2ec0e82 from master

comment:5 Changed 15 months ago by Tim Graham <timograham@…>

In 1cce00a7620f1882b3b1999e799eb1d3cc65c1ca:

[1.6.x] Fixed #22372 -- Improved description of WizardView.get_context_data().

Thanks simon29 for the report.

Backport of a8e2ec0e82 from master

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