mirror of https://github.com/django/django.git
Removed unnecessary parentheses in various code.
This commit is contained in:
parent
11e327a3ff
commit
e649d691f8
|
@ -126,7 +126,7 @@ class ViewIndexView(BaseAdminDocsView):
|
|||
'full_name': get_view_name(func),
|
||||
'url': simplify_regex(regex),
|
||||
'url_name': ':'.join((namespace or []) + (name and [name] or [])),
|
||||
'namespace': ':'.join((namespace or [])),
|
||||
'namespace': ':'.join(namespace or []),
|
||||
'name': name,
|
||||
})
|
||||
return super().get_context_data(**{**kwargs, 'views': views})
|
||||
|
|
|
@ -556,7 +556,7 @@ class Command(BaseCommand):
|
|||
|
||||
input_files = [bf.work_path for bf in build_files]
|
||||
with NamedTemporaryFile(mode='w+') as input_files_list:
|
||||
input_files_list.write(('\n'.join(input_files)))
|
||||
input_files_list.write('\n'.join(input_files))
|
||||
input_files_list.flush()
|
||||
args.extend(['--files-from', input_files_list.name])
|
||||
args.extend(self.xgettext_options)
|
||||
|
|
|
@ -657,7 +657,7 @@ class StateTests(SimpleTestCase):
|
|||
return [mod for mod in state.apps.get_models() if mod._meta.model_name == 'a'][0]
|
||||
|
||||
project_state = ProjectState()
|
||||
project_state.add_model((ModelState.from_model(A)))
|
||||
project_state.add_model(ModelState.from_model(A))
|
||||
self.assertEqual(len(get_model_a(project_state)._meta.related_objects), 1)
|
||||
old_state = project_state.clone()
|
||||
|
||||
|
|
|
@ -3441,7 +3441,7 @@ class DisjunctionPromotionTests(TestCase):
|
|||
self.assertEqual(str(qs.query).count('LEFT OUTER JOIN'), 3)
|
||||
self.assertEqual(str(qs.query).count('INNER JOIN'), 0)
|
||||
qs = BaseA.objects.filter(
|
||||
(Q(a__f1='foo') | (Q(a__f1='bar')) & (Q(b__f1='bar') | Q(c__f1='foo')))
|
||||
Q(a__f1='foo') | Q(a__f1='bar') & (Q(b__f1='bar') | Q(c__f1='foo'))
|
||||
)
|
||||
self.assertEqual(str(qs.query).count('LEFT OUTER JOIN'), 2)
|
||||
self.assertEqual(str(qs.query).count('INNER JOIN'), 1)
|
||||
|
|
Loading…
Reference in New Issue