Skip to content

Commit

Permalink
Merge branch 'master' into bug/integrity-error-azure
Browse files Browse the repository at this point in the history
  • Loading branch information
tiago-peres authored Mar 1, 2023
2 parents 0e8ddac + 3fc92c0 commit 388c0ae
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 109 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: pip
directory: /
schedule:
interval: daily
open-pull-requests-limit: 10
6 changes: 3 additions & 3 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: 3.x
cache: pip
cache-dependency-path: requirements*.txt

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: pip
Expand All @@ -37,7 +37,7 @@ jobs:
run: python setup.py sdist bdist_wheel --python-tag py3

- name: Archive dist
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: dist
path: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
PYTHONUNBUFFERED: 1

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
Expand All @@ -36,12 +36,12 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install tox coverage
pip install coverage tox
- name: Test with tox
run: tox -e "py${PYTHON_VERSION/\./}"

- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
flags: unittests
name: Python ${{ matrix.python-version }}
5 changes: 0 additions & 5 deletions .landscape.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.6.0
rev: v2.7.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2']
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Facebook Limited Login backend

### Changed
- Removed OpenStackDevOpenId backend
- Updated `user_data` method in `StripeOAuth2` to return `email` in `get_user_details`
- Removes fixed version of `lxml`
- Updated Azure to fix IntegrityError at /social-auth/complete/azuread-oauth2/
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pre-commit==2.20.0
pre-commit==3.1.1
5 changes: 1 addition & 4 deletions social_core/backends/clef.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ def get_user_details(self, response):
)

email = info.get("email", "")
if email:
username = email.split("@", 1)[0]
else:
username = info.get("id")
username = email.split("@", 1)[0] if email else info.get("id")

return {
"username": username,
Expand Down
5 changes: 1 addition & 4 deletions social_core/backends/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ def get_user_id(self, details, response):

def get_user_details(self, response):
"""Return user details from Google API account"""
if "email" in response:
email = response["email"]
else:
email = ""
email = response.get("email", "")

name, given_name, family_name = (
response.get("name", ""),
Expand Down
49 changes: 0 additions & 49 deletions social_core/backends/openstackdev.py

This file was deleted.

5 changes: 1 addition & 4 deletions social_core/backends/saml.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ def get_attr(self, attributes, conf_key, default_attribute):
key = self.conf.get(conf_key, default_attribute)
value = attributes[key] if key in attributes else None
if isinstance(value, list):
if len(value):
value = value[0]
else:
value = None
value = value[0] if value else None
return value

@property
Expand Down
5 changes: 1 addition & 4 deletions social_core/pipeline/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ def identity_func(val):

if do_slugify:
override_slug = strategy.setting("SLUGIFY_FUNCTION")
if override_slug:
slug_func = module_member(override_slug)
else:
slug_func = slugify
slug_func = module_member(override_slug) if override_slug else slugify
else:
slug_func = identity_func

Expand Down
7 changes: 2 additions & 5 deletions social_core/tests/backends/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ def handle_state(self, start_url, target_url):
start_query = parse_qs(urlparse(start_url).query)
redirect_uri = start_query.get("redirect_uri")

if getattr(self.backend, "STATE_PARAMETER", False):
if start_query.get("state"):
target_url = url_add_parameters(
target_url, {"state": start_query["state"]}
)
if getattr(self.backend, "STATE_PARAMETER", False) and start_query.get("state"):
target_url = url_add_parameters(target_url, {"state": start_query["state"]})

if redirect_uri and getattr(self.backend, "REDIRECT_STATE", False):
redirect_query = parse_qs(urlparse(redirect_uri).query)
Expand Down
5 changes: 1 addition & 4 deletions social_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ def user_is_authenticated(user):

def user_is_active(user):
if user and hasattr(user, "is_active"):
if callable(user.is_active):
is_active = user.is_active()
else:
is_active = user.is_active
is_active = user.is_active() if callable(user.is_active) else user.is_active
elif user:
is_active = True
else:
Expand Down

0 comments on commit 388c0ae

Please sign in to comment.