diff piecrust/data/iterators.py @ 21:53b9df2263dc

Fix for pages listing pages from other sources.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 18 Aug 2014 23:20:03 -0700
parents 3a13b43e77c1
children e9dc18a275ff
line wrap: on
line diff
--- a/piecrust/data/iterators.py	Mon Aug 18 16:54:00 2014 -0700
+++ b/piecrust/data/iterators.py	Mon Aug 18 23:20:03 2014 -0700
@@ -32,7 +32,10 @@
                 self._cache = inner_list[self.offset:]
 
             if self.current_page:
-                idx = inner_list.index(self.current_page)
+                try:
+                    idx = inner_list.index(self.current_page)
+                except ValueError:
+                    idx = -1
                 if idx >= 0:
                     if idx < self.inner_count - 1:
                         self.next_page = inner_list[idx + 1]