Fix name duplicate check to only run when the template name is changed

Without checking first, a rename is required for all thumbnail template modifications.
pull/460/head
ElementalAlchemist 3 weeks ago committed by Christopher Usher
parent f4d303147d
commit 501549350b

@ -724,6 +724,7 @@ def update_template(name, artist=None):
if results.fetchone() is None: if results.fetchone() is None:
return 'Template with name {} does not exist'.format(name), 400 return 'Template with name {} does not exist'.format(name), 400
# check if new name is in database # check if new name is in database
if name != new_template["name"]:
query = sql.SQL(""" query = sql.SQL("""
SELECT name FROM templates WHERE name = %s SELECT name FROM templates WHERE name = %s
""") """)

Loading…
Cancel
Save