Commits

Anonymous committed af1d67e

Fixed get_recent_posts tag fault. Fixes #2

  • Participants
  • Parent commits b3ca662

Comments (0)

Files changed (1)

File gnocchi/blog/templatetags/blog.py

         username = resolve(self.username)
 
         qset = Post.objects.current()
-        if tags:
-            qset = qset.filter(tag__name__in=tags)
+        for tag in tags:
+            qset = qset.filter(tags__name=tag)
         if username:
             qset = qset.filter(posted_by__username=username)
         context[varname] = qset[:count]
 def get_recent_posts(parser, token):
     args, kwargs, as_name = parse_args(parser, token, 'posts')
     count = args.pop(0)
-    return RecentPostsNode(count, as_name, *args, **kwargs)
+    username = kwargs.pop('username', None)
+    return RecentPostsNode(count, as_name, username, *args, **kwargs)
 
 @register.filter
 def recent_posts(value, username=None):