70 # found autoescape |
70 # found autoescape |
71 if getattr(node, 'arg', None) == 'autoescape': |
71 if getattr(node, 'arg', None) == 'autoescape': |
72 value = getattr(node, 'value', None) |
72 value = getattr(node, 'value', None) |
73 if ( |
73 if ( |
74 getattr(value, 'id', None) == 'True' or |
74 getattr(value, 'id', None) == 'True' or |
75 getattr(value, 'value', None) is True |
75 getattr(value, 'value', None) is True or |
76 ): |
76 (isinstance(value, ast.Call) and |
77 return |
77 (getattr(value.func, 'id', None) == |
78 |
78 'select_autoescape')) |
79 # Check if select_autoescape function is used. |
|
80 elif ( |
|
81 isinstance(value, ast.Call) and |
|
82 (getattr(value.func, 'id', None) == |
|
83 'select_autoescape') |
|
84 ): |
79 ): |
85 return |
80 return |
86 |
81 |
87 else: |
82 else: |
88 reportError( |
83 reportError( |