src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/djangoSqlInjection.py

branch
eric7
changeset 10507
d1c6608155ef
parent 10439
21c28b0f9e41
child 10683
779cda568acb
equal deleted inserted replaced
10506:321555d0303b 10507:d1c6608155ef
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 )

eric ide

mercurial