Skip to content

Conversation

@zed2015
Copy link

@zed2015 zed2015 commented May 11, 2018

fix Api(decorators=()) not work

when I use the api by api = Api(decorators=(mydecorator,)), found mydecorator not work ,so I review the origin code , I found it in Api.route()

view_func = resource.as_view(view)

is before

for decorator in self.decorators:
    if hasattr(resource, 'decorators'):
        resource.decorators += self.decorators
    else:
        resource.decorators = self.decorators

so mydecorator did not work

because that
I changed the code, set the order, mydecorator can work in each func

…urce because as_view is before add decorators
@coveralls
Copy link

coveralls commented May 11, 2018

Coverage Status

Coverage remained the same at 94.112% when pulling 83681bc on zed2015:zed-branch into 79b0abf on miLibris:master.

@akira-dev
Copy link
Collaborator

Already merged

@akira-dev akira-dev closed this Jan 22, 2019
@zed2015 zed2015 deleted the zed-branch branch July 4, 2019 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants