diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2013-07-11 17:18:25 +0200 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2013-07-11 17:18:25 +0200 |
commit | 39deff37c950534d2a44e4bd040e49118b34a731 (patch) | |
tree | 5f950b3c0c9e2ca81b1c6192ea1ef280e0ec7e90 /hyperkitty/views/thread.py | |
parent | 2c7c64b084040ad0666b15c511ff18bb96fc79b9 (diff) | |
download | hyperkitty-39deff37c950534d2a44e4bd040e49118b34a731.tar.gz hyperkitty-39deff37c950534d2a44e4bd040e49118b34a731.tar.xz hyperkitty-39deff37c950534d2a44e4bd040e49118b34a731.zip |
Add the category on the threads list
Diffstat (limited to 'hyperkitty/views/thread.py')
-rw-r--r-- | hyperkitty/views/thread.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hyperkitty/views/thread.py b/hyperkitty/views/thread.py index 365dca9..ecfd6eb 100644 --- a/hyperkitty/views/thread.py +++ b/hyperkitty/views/thread.py @@ -36,6 +36,7 @@ import robot_detection from hyperkitty.models import Tag, Favorite, LastView, ThreadCategory from hyperkitty.views.forms import AddTagForm, ReplyForm, CategoryForm from hyperkitty.lib import get_months, get_store, stripped_subject +from hyperkitty.lib import get_category_widget from hyperkitty.lib.voting import set_message_votes @@ -303,7 +304,10 @@ def set_category(request, mlist_fqdn, threadid): store = get_store(request) category, category_form = get_category_widget(request) thread = store.get_thread(mlist_fqdn, threadid) - if category.name != thread.category: + if not category and thread.category: + thread.category = None + store.commit() + elif category and category.name != thread.category: thread.category = category.name store.commit() |