Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions application/views/blabController.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def blab(request):

# Get comments
logger.info("Executing query to get all comments")
cursor.execute(blabCommentsSql % (blabid,))
cursor.execute(blabCommentsSql, (blabid, ))
blabCommentsResults = cursor.fetchall()

comments = []
Expand Down Expand Up @@ -254,7 +254,8 @@ def blab(request):
with connection.cursor() as cursor:

logger.info("Executing addComment")
cursor.execute(addCommentSql % (blabid, username, comment, moment.now().format("YYYY-MM-DD hh:mm:ss")))
addCommentSql = "INSERT INTO comments (blabid, blabber, content, timestamp) values (%s, %s, %s, %s);"
cursor.execute(addCommentSql, (blabid, username, comment, moment.now().format("YYYY-MM-DD hh:mm:ss")))

if not cursor.rowcount:
request.error = "Failed to add comment"
Expand Down
3 changes: 2 additions & 1 deletion application/views/userController.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,8 @@ def processProfile(request):
logger.info("Preparing the update Prepared Statement")
update = "UPDATE users SET real_name='%s', blab_name='%s' WHERE username='%s';"
logger.info("Executing the update Prepared Statement")
cursor.execute(update % (realName, blabName, sessionUsername), (realName, blabName, sessionUsername))
update = "UPDATE users SET real_name=:realName, blab_name=:blabName WHERE username=:username"
cursor.execute(update, {"realName": realName, "blabName": blabName, "username": sessionUsername})
updateResult = cursor.fetchone()

# If there is a record...
Expand Down