From 8ac23f2927af06244306289c7e60a4f025eb8862 Mon Sep 17 00:00:00 2001 From: ElementalAlchemist Date: Thu, 31 Oct 2024 21:20:34 -0500 Subject: [PATCH] When checking whether a template exists, check the right table --- thrimshim/thrimshim/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/thrimshim/thrimshim/main.py b/thrimshim/thrimshim/main.py index 7d921f2..d5ebf06 100644 --- a/thrimshim/thrimshim/main.py +++ b/thrimshim/thrimshim/main.py @@ -687,7 +687,7 @@ def add_template(artist=None): with app.db_manager.get_conn() as conn: #check if name is already in the database query = sql.SQL(""" - SELECT name FROM events WHERE name = %s + SELECT name FROM templates WHERE name = %s """) results = database.query(conn, query, new_template['name']) if results.fetchone() is not None: @@ -718,14 +718,14 @@ def update_template(name, artist=None): with app.db_manage.get_conn() as conn: #check if template is in database query = sql.SQL(""" - SELECT name FROM events WHERE name = %s + SELECT name FROM templates WHERE name = %s """) results = database.query(conn, query, name) if results.fetchone() is None: return 'Template with name {} does not exist'.format(name), 400 # check if new name is in database query = sql.SQL(""" - SELECT name FROM events WHERE name = %s + SELECT name FROM templates WHERE name = %s """) results = database.query(conn, query, new_template['name']) if results.fetchone() is not None: