changeset 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 c95c90c82263
children df790a827d38
files piecrust/data/iterators.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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]