[lint] Fix indentation in .py files.

This commit is contained in:
Fabien Basmaison 2021-03-04 19:06:12 +01:00
parent 4a8d9bee73
commit 1266a740e5
5 changed files with 12 additions and 8 deletions

View file

@ -10,7 +10,7 @@ class ActivitypubResponse(JsonResponse):
JsonResponse.
"""
def __init__(self, data, encoder=ActivityEncoder, safe=False,
json_dumps_params=None, **kwargs):
json_dumps_params=None, **kwargs):
if 'content_type' not in kwargs:
kwargs['content_type'] = 'application/activity+json'

View file

@ -224,7 +224,7 @@ def isbn_10_to_13(isbn_10):
# multiply the odd digits by 1 and the even digits by 3 and sum them
try:
checksum = sum(int(i) for i in converted[::2]) + \
sum(int(i) * 3 for i in converted[1::2])
sum(int(i) * 3 for i in converted[1::2])
except ValueError:
return None
# add the checksum mod 10 to the end

View file

@ -46,9 +46,11 @@ def validate_username(value):
class ActivitypubFieldMixin:
''' make a database field serializable '''
def __init__(self, *args, \
activitypub_field=None, activitypub_wrapper=None,
deduplication_field=False, **kwargs):
def __init__(
self, *args, \
activitypub_field=None, activitypub_wrapper=None,
deduplication_field=False, **kwargs
):
self.deduplication_field = deduplication_field
if activitypub_wrapper:
self.activitypub_wrapper = activitypub_field

View file

@ -74,8 +74,10 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
for mention_user in self.mention_users.all():
# avoid double-notifying about this status
if not mention_user.local or \
(self.reply_parent and \
mention_user == self.reply_parent.user):
(
self.reply_parent and \
mention_user == self.reply_parent.user
):
continue
notification_model.objects.create(
user=mention_user,

View file

@ -201,7 +201,7 @@ class StatusViews(TestCase):
'archive.org/details/dli.granth.72113/page/n25/mode/2up</a>' \
% url)
url = 'https://openlibrary.org/search' \
'?q=arkady+strugatsky&mode=everything'
'?q=arkady+strugatsky&mode=everything'
self.assertEqual(
views.status.format_links(url),
'<a href="%s">openlibrary.org/search' \