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

fix current_scopes request undefined #94

Merged
merged 3 commits into from
Jul 24, 2017
Merged

fix current_scopes request undefined #94

merged 3 commits into from
Jul 24, 2017

Conversation

gusibi
Copy link
Member

@gusibi gusibi commented Jul 24, 2017

sanic request 不是全局变量 使用时需要作为参数传递


@property
def scopes(self):
return self._loader(current.request)
Copy link
Member

@fantastao fantastao Jul 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loader需要传入参数request,在https://github.com/guokr/swagger-py-codegen/blob/sanic/swagger_py_codegen/templates/sanic/blueprint.tpl#L11的定义应该是

@security.scopes_loader
def current_scopes(request):
    return {{ scopes_supported }}

ps: 默认的lambda: []也应该是lambda x: []

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对,这个两个已经改了

@fantastao fantastao merged commit a40cf4c into master Jul 24, 2017
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.

None yet

2 participants