Skip to content

Commit

Permalink
Merge pull request #349 from python-social-auth/release/5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
omab authored Aug 5, 2021
2 parents a0c8a54 + b368f8e commit fa5c926
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased](https://github.com/python-social-auth/social-app-django/)
## [5.0.0](https://github.com/python-social-auth/social-app-django/releases/tag/5.0.0) - 2021-08-05

### Changed
- Removed compat shims for obsolete Django versions
Expand All @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Added testing for Django 3.0
- Drop support for Python 2
- Django generic `JSONField` support, details documented [here](https://python-social-auth.readthedocs.io/en/latest/configuration/django.html#json-field-support)
- Django 3.2+ compatibility
- Use `_default_manager` instead of `objects`

## [4.0.0](https://github.com/python-social-auth/social-app-django/releases/tag/4.0.0) - 2020-06-20

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
social-auth-core >= 4.0.2
social-auth-core >= 4.1.0
2 changes: 1 addition & 1 deletion social_django/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '4.0.0'
__version__ = '5.0.0'


import django
Expand Down
9 changes: 4 additions & 5 deletions social_django/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

from django.conf import settings
from django.http import Http404
from django.urls import reverse

from social_core.utils import setting_name, module_member, get_strategy
from social_core.exceptions import MissingBackend
from social_core.backends.utils import get_backend
from django.urls import reverse


STRATEGY = getattr(settings, setting_name('STRATEGY'),
Expand All @@ -22,8 +21,7 @@ def load_strategy(request=None):


def load_backend(strategy, name, redirect_uri):
Backend = get_backend(settings.AUTHENTICATION_BACKENDS, name)
return Backend(strategy, redirect_uri)
return strategy.get_backend(name, redirect_uri=redirect_uri)


def psa(redirect_uri=None, load_strategy=load_strategy):
Expand All @@ -41,7 +39,8 @@ def wrapper(request, backend, *args, **kwargs):

try:
request.backend = load_backend(request.social_strategy,
backend, uri)
backend,
redirect_uri=uri)
except MissingBackend:
raise Http404('Backend not found')
return func(request, backend, *args, **kwargs)
Expand Down

0 comments on commit fa5c926

Please sign in to comment.