From 73d601135ccd40878c4ec14036737a6702478deb Mon Sep 17 00:00:00 2001
From: ubq323 <ubq323>
Date: Tue, 15 Jun 2021 23:24:25 +0000
Subject: change tag change messages slightly

---
 apioforum/thread.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/apioforum/thread.py b/apioforum/thread.py
index fd196c5..30b5d84 100644
--- a/apioforum/thread.py
+++ b/apioforum/thread.py
@@ -136,6 +136,7 @@ def config_thread(thread_id):
                 flash("title updated successfully")
                 db.commit()
         if 'do_chtags' in request.form:
+            changed = False
             wanted_tags = []
             for tagid in range(1,len(avail_tags)+1):
                 current = tagid in thread_tags
@@ -143,11 +144,13 @@ def config_thread(thread_id):
                 print(tagid, current, wanted)
                 if wanted and not current:
                     db.execute("insert into thread_tags (thread, tag) values (?,?)",(thread_id,tagid))
-                    flash(f"added tag {tagid}")
+                    changed = True
                 elif current and not wanted:
                     db.execute("delete from thread_tags where thread = ? and tag = ?",(thread_id,tagid))
-                    flash(f"removed tag {tagid}")
-            db.commit()
+                    changed = True
+            if changed:
+                db.commit()
+                flash("tags updated successfully")
 
         if len(err) > 0:
             for e in err:
-- 
cgit v1.2.3