# HG changeset patch # User neko259 # Date 2015-08-06 14:43:59 # Node ID ff69f54a27959ff00cca50cbf2e2804990d939a3 # Parent 7ca9875a5a1a508dcbbcf53f0c28f8b2a966a00c Show only sections in the image tags list in random images diff --git a/boards/models/thread.py b/boards/models/thread.py --- a/boards/models/thread.py +++ b/boards/models/thread.py @@ -225,3 +225,6 @@ class Thread(models.Model): def get_absolute_url(self): return self.get_opening_post().get_absolute_url() + + def get_required_tags(self): + return self.get_tags().filter(required=True) diff --git a/boards/templates/boards/random.html b/boards/templates/boards/random.html --- a/boards/templates/boards/random.html +++ b/boards/templates/boards/random.html @@ -19,7 +19,7 @@ {% with image.get_random_associated_post as post %} >>{{ post.id }}
- {% for tag in post.get_thread.tags.all %} + {% for tag in post.get_thread.get_required_tags.all %} {% autoescape off %} {{ tag.get_view }}{% if not forloop.last %},{% endif %} {% endautoescape %}