Skip to content

Commit

Permalink
chore: Fixed black issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pennersr committed May 19, 2021
1 parent 75e8f07 commit 9f52b43
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion allauth/socialaccount/providers/apple/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def generate_client_secret(self):
return client_secret

def get_client_id(self):
""" We support multiple client_ids, but use the first one for api calls """
"""We support multiple client_ids, but use the first one for api calls"""
return self.consumer_key.split(",")[0]

def get_access_token(self, code):
Expand Down
2 changes: 1 addition & 1 deletion allauth/socialaccount/providers/apple/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def login(self, resp_mock, process="login", with_refresh_token=True):
return resp

def test_authentication_error(self):
""" Override base test because apple posts errors """
"""Override base test because apple posts errors"""
resp = self.client.post(
reverse(self.provider.id + "_callback"),
data={"error": "misc", "state": "testingstate123"},
Expand Down
2 changes: 1 addition & 1 deletion allauth/socialaccount/providers/apple/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def get_user_scope_data(self, request):
return {}

def get_access_token_data(self, request, app, client):
""" We need to gather the info from the apple specific login """
"""We need to gather the info from the apple specific login"""
add_apple_session(request)

# Exchange `code`
Expand Down
15 changes: 10 additions & 5 deletions allauth/socialaccount/providers/frontier/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ def get_profile_url(self):

def get_avatar_url(self):
return "https://www.gravatar.com/avatar/%s?%s" % (
hashlib.md5(self.account.extra_data.get("email").lower().encode('utf-8')).hexdigest(),
urlencode({'d': 'mp'}))
hashlib.md5(
self.account.extra_data.get("email").lower().encode("utf-8")
).hexdigest(),
urlencode({"d": "mp"}),
)

def to_str(self):
dflt = super(FrontierAccount, self).to_str()
full_name = "%s %s" % (self.account.extra_data.get("firstname", dflt),
self.account.extra_data.get("lastname", dflt))
full_name = "%s %s" % (
self.account.extra_data.get("firstname", dflt),
self.account.extra_data.get("lastname", dflt),
)
return full_name


Expand All @@ -28,7 +33,7 @@ class FrontierProvider(OAuth2Provider):
account_class = FrontierAccount

def get_default_scope(self):
scope = ['auth', 'capi']
scope = ["auth", "capi"]
return scope

def extract_uid(self, data):
Expand Down
2 changes: 1 addition & 1 deletion allauth/socialaccount/providers/strava/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_mocked_response_avatar_invalid_id(self):
) # noqa

def test_valid_avatar(self):
""" test response with Avatar URL """
"""test response with Avatar URL"""
self.login(self.get_mocked_response_avatar_invalid_id())
user = User.objects.get(email="[email protected]")
soc_acc = SocialAccount.objects.filter(
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ commands =
skip_install = True
ignore_errors = True
deps =
flake8
isort
black
flake8==3.9.2
isort==5.8.0
black==21.5b1
commands =
flake8 {posargs:{toxinidir}/allauth}
isort --check-only --skip-glob '*/migrations/*' --diff {posargs:{toxinidir}/allauth}
Expand Down

0 comments on commit 9f52b43

Please sign in to comment.