fix code style
This commit is contained in:
parent
d35af9de80
commit
cc943450e2
2 changed files with 7 additions and 6 deletions
|
@ -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": {}
|
||||
}
|
||||
)
|
||||
|
|
|
@ -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})
|
||||
|
|
Loading…
Reference in a new issue