mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-24 11:51:27 -08:00
clear topic cache when topics change
This commit is contained in:
parent
e759e7afb1
commit
30f2b5a681
1 changed files with 4 additions and 0 deletions
|
@ -417,6 +417,7 @@ def admin_topic_add():
|
||||||
topic.parent_id = None
|
topic.parent_id = None
|
||||||
db.session.add(topic)
|
db.session.add(topic)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
cache.delete_memoized(menu_topics)
|
||||||
|
|
||||||
flash(_('Saved'))
|
flash(_('Saved'))
|
||||||
return redirect(url_for('admin.admin_topics'))
|
return redirect(url_for('admin.admin_topics'))
|
||||||
|
@ -444,6 +445,7 @@ def admin_topic_edit(topic_id):
|
||||||
else:
|
else:
|
||||||
topic.parent_id = None
|
topic.parent_id = None
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
cache.delete_memoized(menu_topics)
|
||||||
flash(_('Saved'))
|
flash(_('Saved'))
|
||||||
return redirect(url_for('admin.admin_topics'))
|
return redirect(url_for('admin.admin_topics'))
|
||||||
else:
|
else:
|
||||||
|
@ -471,6 +473,8 @@ def admin_topic_delete(topic_id):
|
||||||
flash(_('Cannot delete topic with communities assigned to it.', 'error'))
|
flash(_('Cannot delete topic with communities assigned to it.', 'error'))
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
cache.delete_memoized(menu_topics)
|
||||||
|
|
||||||
return redirect(url_for('admin.admin_topics'))
|
return redirect(url_for('admin.admin_topics'))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue