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

branch
eric7
changeset 10507
d1c6608155ef
parent 10439
21c28b0f9e41
child 10683
779cda568acb
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/djangoSqlInjection.py	Tue Jan 16 14:35:46 2024 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/djangoSqlInjection.py	Tue Jan 16 18:24:06 2024 +0100
@@ -125,7 +125,11 @@
         context.isModuleImportedLike("django.db.models")
         and context.callFunctionName == "RawSQL"
     ):
-        sql = context.node.args[0]
+        if context.node.args:
+            sql = context.node.args[0]
+        else:
+            kwargs = keywords2dict(context.node.keywords)
+            sql = kwargs["sql"]
         if not AstUtilities.isString(sql):
             reportError(
                 context.node.lineno - 1, context.node.col_offset, "S611", "M", "M"

eric ide

mercurial