Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#15342 closed (fixed)

Example of decorated class-based generic view is missing *args

Reported by: jnns Owned by: nobody
Component: Documentation Version: 1.3-beta
Severity: Keywords: class-based generic views, documentation
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

In http://docs.djangoproject.com/en/dev/topics/class-based-views/#decorating-the-class


@method_decorator(login_required)
    def dispatch(self, *args, **kwargs):
        return super(ProtectedView, self).dispatch(**kwargs)

has to be


@method_decorator(login_required)
    def dispatch(self, *args, **kwargs):
        return super(ProtectedView, self).dispatch(*args, **kwargs)

Attachments (1)

15342.patch (583 bytes) - added by jnns 3 years ago.
Adds *args to decorated dispatch() example

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by jnns

Adds *args to decorated dispatch() example

comment:1 Changed 3 years ago by gabrielhurley

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

In [15564]:

Fixed #15342 -- Passed *args through to the parent class' dispatch method in the CBV example. Thanks to jnns for the report and patch.

comment:2 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.