Skip to content
Merged
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
10 changes: 5 additions & 5 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def get(self):
sql = sql_text("""
SELECT data, key, description, to_char(date, 'YYYY-MM-DD') as date
FROM {table}
WHERE username = :user ORDER BY {sort_order}
WHERE username = :username ORDER BY {sort_order}
""".format(table=user_bookmark_table, sort_order=sort_order))
try:
data = []
Expand Down Expand Up @@ -332,8 +332,8 @@ def post(self):
else:
sql = sql_text("""
INSERT INTO {table} (username, data, key, date, description)
VALUES (:user, :data, :key, :date, :description)
ON CONFLICT (username,key) WHERE username = :user
VALUES (:username, :data, :key, :date, :description)
ON CONFLICT (username,key) WHERE username = :username
DO
UPDATE
SET data = :data, date = :date, description = :description
Expand Down Expand Up @@ -375,7 +375,7 @@ def get(self, key):
sql = sql_text("""
SELECT data
FROM {table}
WHERE username = :user and key = :key
WHERE username = :username and key = :key
""".format(table=user_bookmark_table))
try:
with db_engine.connect() as connection:
Expand Down Expand Up @@ -461,7 +461,7 @@ def put(self, key):
sql = sql_text("""
UPDATE {table}
SET data = :data, date = :date, description = :description
WHERE username = :user and key = :key
WHERE username = :username and key = :key
""".format(table=user_bookmark_table))

with db_engine.begin() as connection:
Expand Down