Skip to content

Commit 362813d

Browse files
authored
Fixed hanging indentation in various code.
1 parent aeb8c38 commit 362813d

File tree

40 files changed

+266
-232
lines changed

40 files changed

+266
-232
lines changed

django/contrib/messages/storage/fallback.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ def _store(self, messages, response, *args, **kwargs):
4545
"""
4646
for storage in self.storages:
4747
if messages:
48-
messages = storage._store(messages, response,
49-
remove_oldest=False)
48+
messages = storage._store(messages, response, remove_oldest=False)
5049
# Even if there are no more messages, continue iterating to ensure
5150
# storages which contained messages are flushed.
5251
elif storage in self._used_storages:

django/core/mail/message.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,7 @@ def _create_attachment(self, filename, content, mimetype=None):
397397
filename.encode('ascii')
398398
except UnicodeEncodeError:
399399
filename = ('utf-8', '', filename)
400-
attachment.add_header('Content-Disposition', 'attachment',
401-
filename=filename)
400+
attachment.add_header('Content-Disposition', 'attachment', filename=filename)
402401
return attachment
403402

404403
def _set_list_header_if_not_empty(self, msg, header, values):

django/db/backends/postgresql/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ def _nodb_connection(self):
263263
nodb_connection = self.__class__(
264264
self.settings_dict.copy(),
265265
alias=self.alias,
266-
allow_thread_sharing=False)
266+
allow_thread_sharing=False,
267+
)
267268
return nodb_connection
268269

269270
@cached_property

django/forms/forms.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ def as_table(self):
281281
error_row='<tr><td colspan="2">%s</td></tr>',
282282
row_ender='</td></tr>',
283283
help_text_html='<br><span class="helptext">%s</span>',
284-
errors_on_separate_row=False)
284+
errors_on_separate_row=False,
285+
)
285286

286287
def as_ul(self):
287288
"Return this form rendered as HTML <li>s -- excluding the <ul></ul>."
@@ -290,7 +291,8 @@ def as_ul(self):
290291
error_row='<li>%s</li>',
291292
row_ender='</li>',
292293
help_text_html=' <span class="helptext">%s</span>',
293-
errors_on_separate_row=False)
294+
errors_on_separate_row=False,
295+
)
294296

295297
def as_p(self):
296298
"Return this form rendered as HTML <p>s."
@@ -299,7 +301,8 @@ def as_p(self):
299301
error_row='%s',
300302
row_ender='</p>',
301303
help_text_html=' <span class="helptext">%s</span>',
302-
errors_on_separate_row=True)
304+
errors_on_separate_row=True,
305+
)
303306

304307
def non_field_errors(self):
305308
"""

django/middleware/common.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def process_response(self, request, response):
130130
),
131131
"Referrer: %s\nRequested URL: %s\nUser agent: %s\n"
132132
"IP address: %s\n" % (referer, path, ua, ip),
133-
fail_silently=True)
133+
fail_silently=True,
134+
)
134135
return response
135136

136137
def is_internal_request(self, domain, referer):

django/test/runner.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ def run(self, result):
356356
pool = multiprocessing.Pool(
357357
processes=self.processes,
358358
initializer=self.init_worker.__func__,
359-
initargs=[counter])
359+
initargs=[counter],
360+
)
360361
args = [
361362
(self.runner_class, index, subsuite, self.failfast)
362363
for index, subsuite in enumerate(self.subsuites)

django/utils/translation/trans_real.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ def _new_gnu_trans(self, localedir, use_null_fallback=True):
146146
localedir=localedir,
147147
languages=[self.__locale],
148148
codeset='utf-8',
149-
fallback=use_null_fallback)
149+
fallback=use_null_fallback,
150+
)
150151

151152
def _init_translation_catalog(self):
152153
"""Create a base catalog using global django translations."""

tests/admin_views/admin.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ def download(modeladmin, request, selected):
282282

283283

284284
def no_perm(modeladmin, request, selected):
285-
return HttpResponse(content='No permission to perform this action',
286-
status=403)
285+
return HttpResponse(content='No permission to perform this action', status=403)
287286

288287

289288
no_perm.short_description = 'No permission to run'
@@ -685,11 +684,7 @@ def extra(self, request):
685684

686685
def get_urls(self):
687686
# Corner case: Don't call parent implementation
688-
return [
689-
url(r'^extra/$',
690-
self.extra,
691-
name='cable_extra'),
692-
]
687+
return [url(r'^extra/$', self.extra, name='cable_extra')]
693688

694689

695690
class CustomTemplateBooleanFieldListFilter(BooleanFieldListFilter):

tests/annotations/tests.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,10 @@ def test_annotation_with_m2m(self):
283283

284284
def test_annotation_reverse_m2m(self):
285285
books = Book.objects.annotate(
286-
store_name=F('store__name')).filter(
287-
name='Practical Django Projects').order_by(
288-
'store_name')
286+
store_name=F('store__name'),
287+
).filter(
288+
name='Practical Django Projects',
289+
).order_by('store_name')
289290

290291
self.assertQuerysetEqual(
291292
books, [
@@ -497,7 +498,8 @@ class Lower(Func):
497498
F('ticker_name'),
498499
F('description'),
499500
Value('No Tag'),
500-
function='COALESCE')
501+
function='COALESCE',
502+
)
501503
).annotate(
502504
tagline_lower=Lower(F('tagline'), output_field=CharField())
503505
).order_by('name')

tests/auth_tests/test_auth_backends.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,8 @@ def test_changed_backend_settings(self):
559559
# Get a session for the test user
560560
self.assertTrue(self.client.login(
561561
username=self.TEST_USERNAME,
562-
password=self.TEST_PASSWORD)
563-
)
562+
password=self.TEST_PASSWORD,
563+
))
564564
# Prepare a request object
565565
request = HttpRequest()
566566
request.session = self.client.session

0 commit comments

Comments
 (0)