diff options
author | ubq323 <ubq323> | 2021-06-15 23:24:25 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-06-15 23:24:25 +0000 |
commit | 73d601135ccd40878c4ec14036737a6702478deb (patch) | |
tree | f755c78fb98f8f932bf458c200571d389cdf452d | |
parent | 2ed3c6588c6463e28a1f7e58a396f2cb590327cd (diff) |
change tag change messages slightly
-rw-r--r-- | apioforum/thread.py | 9 |
1 files 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: |