Django

Code

Ticket #6679 (closed: fixed)

Opened 4 months ago

Last modified 4 months ago

decorator_from_middleware() doesn't call process_view() properly

Reported by: Gulopine Assigned to: gwilson
Milestone: Component: Uncategorized
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

In django.utils.decorators.decorator_from_middleware(), the portion which calls the middleware's process_view() method does with the dynamic argument modifies * and **, even though the middleware protocol specifies that the args and kwargs values should come in as separate distinct arguments.

If this function is used to transform any middleware that implements the process_view() method into a decorator, a TypeError is raised when any view using that decorator is executed.

TypeError: process_view() got an unexpected keyword argument '...'

Attachments

6679.diff (0.6 kB) - added by Gulopine on 02/27/08 21:03:44.
Simple fix, removing the argument modifiers so process_view() gets called the way it should

Change History

02/27/08 21:03:44 changed by Gulopine

  • attachment 6679.diff added.

Simple fix, removing the argument modifiers so process_view() gets called the way it should

02/29/08 15:09:23 changed by Simon G <dev at simon dot net dot nz>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

03/17/08 12:01:26 changed by gwilson

  • owner changed from nobody to gwilson.
  • status changed from new to assigned.

working on some tests...

03/17/08 12:47:35 changed by gwilson

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [7269]) Fixed #6679 -- In decorator_from_middleware, don't unpack arguments when calling a middleware's process_view method, thanks Gulopine.


Add/Change #6679 (decorator_from_middleware() doesn't call process_view() properly)




Change Properties
Action