123 """ |
123 """ |
124 if ( |
124 if ( |
125 context.isModuleImportedLike("django.db.models") |
125 context.isModuleImportedLike("django.db.models") |
126 and context.callFunctionName == "RawSQL" |
126 and context.callFunctionName == "RawSQL" |
127 ): |
127 ): |
128 sql = context.node.args[0] |
128 if context.node.args: |
|
129 sql = context.node.args[0] |
|
130 else: |
|
131 kwargs = keywords2dict(context.node.keywords) |
|
132 sql = kwargs["sql"] |
129 if not AstUtilities.isString(sql): |
133 if not AstUtilities.isString(sql): |
130 reportError( |
134 reportError( |
131 context.node.lineno - 1, context.node.col_offset, "S611", "M", "M" |
135 context.node.lineno - 1, context.node.col_offset, "S611", "M", "M" |
132 ) |
136 ) |