﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
10525	staff_member_required doesn't work for FormWizard / __call__()	Alpha1650	nobody	"Hi,

The ""staff_member_required"" decorator doesn't work for FormWizard or in general for decorating methods as for example _ _call_ _(). That's because the decorator expects the first argument to be a request instance but with methods the first argument is self and the second argument is the request object.

The patch changes this by adding a check whether the object to be decorated is a function or a method. Then it decorates the appropriate way.

In order to decorate FormWizard's _ _call_ _() you have to do this:

{{{

from django.contrib.formtools.wizard import FormWizard
from django.contrib.admin.views.decorators import staff_member_required

class Wizard(FormWizard):
    # ...
    pass

Wizard.__call__ = staff_member_required(Wizard.__call__)
}}}

I added my changes as a patch.

Alpha1650"		closed	contrib.admin	dev		invalid	staff_member_required, FormWizard		Unreviewed	1	0	0	0	0	0
