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: