# HG changeset patch # User neko259 # Date 2013-06-16 21:27:32 # Node ID b885349699ea6b014448e89a9a2694042cf43924 # Parent 938852d97cc63ac68f02b88b9ddaa821daa5c128 Quick fix for the 404 page defect. Now 404 page is not shown for tags, this must be investigated further. This refs #50 diff --git a/boards/models.py b/boards/models.py --- a/boards/models.py +++ b/boards/models.py @@ -63,16 +63,16 @@ class PostManager(models.Manager): for post in posts: self.delete_post(post) - def get_threads(self, tag=None, page=ALL_PAGES): + def get_threads(self, tag=None, page=ALL_PAGES, + order_by='-last_edit_time'): if tag: threads = self.filter(parent=NO_PARENT, tags=tag) + + # TODO Throw error 404 if no threads for tag found? else: threads = self.filter(parent=NO_PARENT) - if not threads: - raise Http404 - - threads = threads.order_by('-last_edit_time') + threads = threads.order_by(order_by) if page != ALL_PAGES: thread_count = len(threads)