Browse Source

small refactor

Oz N Tiram 9 years ago
parent
commit
e9fdbaadf6
1 changed files with 2 additions and 3 deletions
  1. 2 3
      blogit/blogit.py

+ 2 - 3
blogit/blogit.py

@@ -131,10 +131,9 @@ class Tag(object):
         Posts = Query()
         for id in self.posts:
             post = self.db.posts.get(eid=id)
-            if post:  # pragma: no coverage
-                yield Entry(os.path.join(CONFIG['content_root'], post['filename']), id)
-            else:
+            if not post:  # pragma: no coverage
                 raise ValueError("No post found for eid %s" % id)
+            yield Entry(os.path.join(CONFIG['content_root'], post['filename']), id)
 
     def render(self):
         """Render html page and atom feed"""