Commits

Patrick Samson committed fe9b177

Fix issue #32

Comments (0)

Files changed (5)

 Django Postman changelog
 ========================
 
+Version 3.0.1, August 2013
+--------------------------
+* Fix issue #32, an IndexError when a Paginator is used and the folder is empty.
+
 Version 3.0.0, July 2013
 ------------------------
 * !MAJOR! Redesign the DB queries for the 'by conversation' mode,
 # The short X.Y version.
 version = '3.0'
 # The full version, including alpha/beta/rc tags.
-release = '3.0.0'
+release = '3.0.1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

postman/__init__.py

 from __future__ import unicode_literals
 
 # following PEP 386: N.N[.N]+[{a|b|c|rc}N[.N]+][.postN][.devN]
-VERSION = (3, 0, 0)
+VERSION = (3, 0, 1)
 PREREL = ()
 POST = 0
 DEV = 0
     # @Override
     def as_sql(self, *args, **kwargs):
         sql, params = self._target.as_sql(*args, **kwargs)
+        if not sql:  # is the case with a Paginator on an empty folder
+            return sql, params
         # mimics compiler.py/SQLCompiler/get_from_clause() and as_sql()
         qn = self.quote_name_unless_alias
         qn2 = self.connection.ops.quote_name
     Usual generic tests.
     """
     def test_version(self):
-        self.assertEqual(sys.modules['postman'].__version__, "3.0.0")
+        self.assertEqual(sys.modules['postman'].__version__, "3.0.1")
 
 
 class BaseTest(TestCase):