Skip to content

Commit

Permalink
Modify S3649(Python): Fix logic error (#4598)
Browse files Browse the repository at this point in the history
  • Loading branch information
loris-s-sonarsource authored Jan 7, 2025
1 parent aa70967 commit dff46bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rules/S3649/python/how-to-fix-it/sqlalchemy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import sqlalchemy
@app.route('/example')
def get_users():
user = request.args["user"]
conn = sqlalchemy.create_engine(connection_string)
engine = sqlalchemy.create_engine(connection_string)
conn = engine.connect()
conn.execute("SELECT user FROM users WHERE user = '" + user + "'") # Noncompliant
Expand All @@ -43,7 +43,7 @@ import sqlalchemy
@app.route('/example')
def get_users():
user = request.args["user"]
conn = sqlalchemy.create_engine(connection_string)
engine = sqlalchemy.create_engine(connection_string)
metadata = sqlalchemy.MetaData(bind=conn, reflect=True)
users = metadata.tables['users']
conn = engine.connect()
Expand Down

0 comments on commit dff46bd

Please sign in to comment.