Python: Fix handling of turbogears' 'expose' decorator.

This commit is contained in:
Mark Shannon
2019-02-26 16:40:21 +00:00
parent 3854050d57
commit 2995b023fa

View File

@@ -19,14 +19,10 @@ class TurboGearsControllerMethod extends Function {
TurboGearsControllerMethod() {
aTurboGearsControllerClass().getPyClass() = this.getScope() and
decorator = this.getADecorator().getAFlowNode() and
/* Is decorated with @expose or @expose(path) */
/* Is decorated with @expose() or @expose(path) */
(
decorator.(NameNode).getId() = "expose"
or
decorator.(CallNode).getFunction().(NameNode).getId() = "expose"
or
decorator.refersTo(ModuleObject::named("tg").getAttribute("expose"))
or
decorator.refersTo(_, ModuleObject::named("tg").getAttribute("expose"), _)
)
}