From: Patrick Samson Date: Sat, 3 Aug 2013 20:11:14 +0000 (+0200) Subject: Fix issue #32 X-Git-Tag: 3.0.1 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f1cba3b7e174bf01e3af41e1dd245afe3ec71be9;p=django-postman.git Fix issue #32 --- diff --git a/CHANGELOG b/CHANGELOG index 02a64b6..be75a53 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,10 @@ 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, diff --git a/docs/conf.py b/docs/conf.py index c704077..972e1b6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,7 @@ copyright = u'2010, Patrick Samson' # 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. diff --git a/postman/__init__.py b/postman/__init__.py index 0d02e1b..decc7d4 100644 --- a/postman/__init__.py +++ b/postman/__init__.py @@ -4,7 +4,7 @@ A messaging application for Django 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 diff --git a/postman/query.py b/postman/query.py index 59dd04e..a0a17b5 100644 --- a/postman/query.py +++ b/postman/query.py @@ -36,6 +36,8 @@ class CompilerProxy(Proxy): # @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 diff --git a/postman/tests.py b/postman/tests.py index b7055bb..d5fae8e 100644 --- a/postman/tests.py +++ b/postman/tests.py @@ -76,7 +76,7 @@ class GenericTest(TestCase): 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):