From cc943450e263df3bf00249b1a7fa654b9b81a9c7 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Mon, 18 Jan 2016 23:48:43 +0100 Subject: [PATCH] fix code style --- cms_helper.py | 5 +++-- djangocms_blog/managers.py | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) 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})