fix code style

This commit is contained in:
Iacopo Spalletti 2016-01-18 23:48:43 +01:00
parent d35af9de80
commit cc943450e2
2 changed files with 7 additions and 6 deletions

View file

@ -4,7 +4,8 @@ from __future__ import absolute_import, print_function, unicode_literals
from tempfile import mkdtemp from tempfile import mkdtemp
gettext = lambda s: s
def gettext(s): return s
HELPER_SETTINGS = dict( HELPER_SETTINGS = dict(
ROOT_URLCONF='tests.test_utils.urls', ROOT_URLCONF='tests.test_utils.urls',
@ -91,7 +92,7 @@ HELPER_SETTINGS = dict(
), ),
FILE_UPLOAD_TEMP_DIR=mkdtemp(), FILE_UPLOAD_TEMP_DIR=mkdtemp(),
SITE_ID=1, SITE_ID=1,
HAYSTACK_CONNECTIONS = { HAYSTACK_CONNECTIONS={
"default": {} "default": {}
} }
) )

View file

@ -99,8 +99,8 @@ class GenericDateQuerySet(AppHookConfigTranslatableQueryset):
queryset = self.on_site() queryset = self.on_site()
if self.end_date_field: if self.end_date_field:
qfilter = ( qfilter = (
models.Q(**{'%s__gte' % self.end_date_field: now()}) models.Q(**{'%s__gte' % self.end_date_field: now()}) |
| models.Q(**{'%s__isnull' % self.end_date_field: True}) models.Q(**{'%s__isnull' % self.end_date_field: True})
) )
queryset = queryset.filter(qfilter) queryset = queryset.filter(qfilter)
return queryset.filter(**{self.publish_field: True}) return queryset.filter(**{self.publish_field: True})
@ -109,8 +109,8 @@ class GenericDateQuerySet(AppHookConfigTranslatableQueryset):
queryset = self.on_site() queryset = self.on_site()
if self.end_date_field: if self.end_date_field:
qfilter = ( qfilter = (
models.Q(**{'%s__lte' % self.end_date_field: now()}) models.Q(**{'%s__lte' % self.end_date_field: now()}) |
| models.Q(**{'%s__isnull' % self.end_date_field: False}) models.Q(**{'%s__isnull' % self.end_date_field: False})
) )
queryset = queryset.filter(qfilter) queryset = queryset.filter(qfilter)
return queryset.filter(**{self.publish_field: True}) return queryset.filter(**{self.publish_field: True})