diff --git a/cms_helper.py b/cms_helper.py index 0a95a18..40ac322 100755 --- a/cms_helper.py +++ b/cms_helper.py @@ -4,7 +4,8 @@ from __future__ import absolute_import, print_function, unicode_literals from tempfile import mkdtemp -gettext = lambda s: s + +def gettext(s): return s HELPER_SETTINGS = dict( ROOT_URLCONF='tests.test_utils.urls', @@ -91,7 +92,7 @@ HELPER_SETTINGS = dict( ), FILE_UPLOAD_TEMP_DIR=mkdtemp(), SITE_ID=1, - HAYSTACK_CONNECTIONS = { + HAYSTACK_CONNECTIONS={ "default": {} } ) diff --git a/djangocms_blog/managers.py b/djangocms_blog/managers.py index 644fbc6..ecd1900 100644 --- a/djangocms_blog/managers.py +++ b/djangocms_blog/managers.py @@ -99,8 +99,8 @@ class GenericDateQuerySet(AppHookConfigTranslatableQueryset): queryset = self.on_site() if self.end_date_field: qfilter = ( - models.Q(**{'%s__gte' % self.end_date_field: now()}) - | models.Q(**{'%s__isnull' % self.end_date_field: True}) + models.Q(**{'%s__gte' % self.end_date_field: now()}) | + models.Q(**{'%s__isnull' % self.end_date_field: True}) ) queryset = queryset.filter(qfilter) return queryset.filter(**{self.publish_field: True}) @@ -109,8 +109,8 @@ class GenericDateQuerySet(AppHookConfigTranslatableQueryset): queryset = self.on_site() if self.end_date_field: qfilter = ( - models.Q(**{'%s__lte' % self.end_date_field: now()}) - | models.Q(**{'%s__isnull' % self.end_date_field: False}) + models.Q(**{'%s__lte' % self.end_date_field: now()}) | + models.Q(**{'%s__isnull' % self.end_date_field: False}) ) queryset = queryset.filter(qfilter) return queryset.filter(**{self.publish_field: True})