Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With nested decorators and plugins gives errors during requests #11

Open
andrew-azarov opened this issue Jul 14, 2017 · 0 comments
Open

Comments

@andrew-azarov
Copy link

If I leave something like

    @app.route(APPROOT + '/new', method=['GET', 'POST'])
    @valid_user()
    def new(db):

I get this
TypeError: new() takes exactly 1 argument (0 given)

If I do db=None


    @app.route(APPROOT + '/new', method=['GET', 'POST'])
    @valid_user()
    def new(db=None):

I get

AttributeError: 'NoneType' object has no attribute 'execute'

Seems like the bottlesession decorator is in the way. And it's not just bottlesession

You can check with basic auth decorators as well, I had to functionally rewrite basic auth because plugin retrospection gives Nonetype object bug as well. For example this one https://gist.github.com/thinkxl/8296214
or this one
https://stackoverflow.com/questions/13272528/bottle-py-http-auth

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

No branches or pull requests

1 participant