Hello community,
here is the log from the commit of package python-social-auth-app-django for openSUSE:Factory checked in at 2018-12-03 10:12:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-social-auth-app-django (Old)
and /work/SRC/openSUSE:Factory/.python-social-auth-app-django.new.19453 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-social-auth-app-django"
Mon Dec 3 10:12:32 2018 rev:2 rq:653426 version:3.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-social-auth-app-django/python-social-auth-app-django.changes 2018-08-03 12:36:56.759537879 +0200
+++ /work/SRC/openSUSE:Factory/.python-social-auth-app-django.new.19453/python-social-auth-app-django.changes 2018-12-03 10:12:40.215582379 +0100
@@ -1,0 +2,18 @@
+Fri Nov 30 10:20:04 UTC 2018 - Matthias Fehring
+
+- Update to version 3.1.0
+ * Updated JSONField.from_db_value signature to support multiple
+ Django versions by accepting just the needed parameters.
+- Changes from version 3.0.0
+ * Reduce log level of exceptions to INFO if messages app is installed
+ * Encode association secret with encodebytes if available
+ * Decode association secret for proper storage
+ * Remove obsolete code from JSONField
+ * Pass user as keyword argument to do_complete
+ * Cleanup username when using email as username
+ * Drop Python 3.3 support
+ * Correct spelling errors
+ * Correct version that renamed field.rel
+ * Reduce error logs in SocialAuthExceptionMiddleware
+
+-------------------------------------------------------------------
Old:
----
social-auth-app-django-2.1.0.tar.gz
New:
----
social-auth-app-django-3.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-social-auth-app-django.spec ++++++
--- /var/tmp/diff_new_pack.AjgzDf/_old 2018-12-03 10:12:40.899581745 +0100
+++ /var/tmp/diff_new_pack.AjgzDf/_new 2018-12-03 10:12:40.899581745 +0100
@@ -12,29 +12,29 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-social-auth-app-django
-Version: 2.1.0
+Version: 3.1.0
Release: 0
Summary: Python Social Authentication, Django integration
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/python-social-auth/social-app-django
Source: https://files.pythonhosted.org/packages/source/s/social-auth-app-django/social-auth-app-django-%{version}.tar.gz
+BuildRequires: %{python_module Django >= 1.11}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: %{python_module social-auth-core >= 1.2.0}
-BuildRequires: %{python_module Django >= 1.11}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
+Requires: python-Django >= 1.11
Requires: python-six
Requires: python-social-auth-core >= 1.2.0
-Requires: python-Django >= 1.11
BuildArch: noarch
%python_subpackages
++++++ social-auth-app-django-2.1.0.tar.gz -> social-auth-app-django-3.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/CHANGELOG.md new/social-auth-app-django-3.1.0/CHANGELOG.md
--- old/social-auth-app-django-2.1.0/CHANGELOG.md 2017-12-22 13:44:21.000000000 +0100
+++ new/social-auth-app-django-3.1.0/CHANGELOG.md 2018-10-31 15:43:54.000000000 +0100
@@ -5,7 +5,25 @@
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/commits/master)
+## [3.1.0](https://github.com/python-social-auth/social-app-django/releases/tag/3.1.0) - 2018-10-31
+
+### Changed
+- Updated `JSONField.from_db_value` signature to support multiple Django
+ versions by accepting just the needed parameters.
+
+## [3.0.0](https://github.com/python-social-auth/social-app-django/releases/tag/3.0.0) - 2018-10-28
+
+### Changed
+- Reduce log level of exceptions to `INFO` if messages app is installed
+- Encode association secret with `encodebytes` if available
+- Decode association secret for proper storage
+- Remove obsolete code from JSONField
+- Pass `user` as keyword argument to `do_complete`
+- Cleanup `username` when using email as username
+- Drop Python 3.3 support
+- Correct spelling errors
+- Correct version that renamed `field.rel`
+- Reduce error logs in `SocialAuthExceptionMiddleware`
## [2.1.0](https://github.com/python-social-auth/social-app-django/releases/tag/2.1.0) - 2017-12-22
@@ -13,6 +31,7 @@
- Use Django `urlquote` since it handles unicode
- Remove version check in favor of import error catch
- Remove call to deprecated method `_get_val_from_obj()`
+- Drop Python 3.3 support
## [2.0.0](https://github.com/python-social-auth/social-app-django/releases/tag/2.0.0) - 2017-10-28
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/PKG-INFO new/social-auth-app-django-3.1.0/PKG-INFO
--- old/social-auth-app-django-2.1.0/PKG-INFO 2017-12-22 13:49:21.000000000 +0100
+++ new/social-auth-app-django-3.1.0/PKG-INFO 2018-10-31 15:46:24.000000000 +0100
@@ -1,16 +1,16 @@
Metadata-Version: 1.1
Name: social-auth-app-django
-Version: 2.1.0
+Version: 3.1.0
Summary: Python Social Authentication, Django integration.
Home-page: https://github.com/python-social-auth/social-app-django
Author: Matias Aguirre
Author-email: matiasaguirre@gmail.com
License: BSD
-Description-Content-Type: UNKNOWN
Description: # Python Social Auth - Django
[![Build Status](https://travis-ci.org/python-social-auth/social-app-django.svg?branch=master)](https://travis-ci.org/python-social-auth/social-app-django)
[![Donate](https://img.shields.io/badge/Donate-PayPal-orange.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=matiasaguirre%40gmail%2ecom&lc=US&item_name=Python%20Social%20Auth&no_note=0¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest)
+ [![PyPI version](https://badge.fury.io/py/social-auth-app-django.svg)](https://badge.fury.io/py/social-auth-app-django)
Python Social Auth is an easy to setup social authentication/registration
mechanism with support for several frameworks and auth providers.
@@ -54,7 +54,7 @@
## Donations
- This project is maintened on my spare time, consider donating to keep
+ This project is maintained on my spare time, consider donating to keep
it improving.
[![Donate](https://img.shields.io/badge/Donate-PayPal-orange.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=matiasaguirre%40gmail%2ecom&lc=US&item_name=Python%20Social%20Auth&no_note=0¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/README.md new/social-auth-app-django-3.1.0/README.md
--- old/social-auth-app-django-2.1.0/README.md 2017-05-06 14:05:26.000000000 +0200
+++ new/social-auth-app-django-3.1.0/README.md 2018-10-28 21:12:02.000000000 +0100
@@ -2,6 +2,7 @@
[![Build Status](https://travis-ci.org/python-social-auth/social-app-django.svg?branch=master)](https://travis-ci.org/python-social-auth/social-app-django)
[![Donate](https://img.shields.io/badge/Donate-PayPal-orange.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=matiasaguirre%40gmail%2ecom&lc=US&item_name=Python%20Social%20Auth&no_note=0¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest)
+[![PyPI version](https://badge.fury.io/py/social-auth-app-django.svg)](https://badge.fury.io/py/social-auth-app-django)
Python Social Auth is an easy to setup social authentication/registration
mechanism with support for several frameworks and auth providers.
@@ -45,7 +46,7 @@
## Donations
-This project is maintened on my spare time, consider donating to keep
+This project is maintained on my spare time, consider donating to keep
it improving.
[![Donate](https://img.shields.io/badge/Donate-PayPal-orange.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=matiasaguirre%40gmail%2ecom&lc=US&item_name=Python%20Social%20Auth&no_note=0¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/setup.py new/social-auth-app-django-3.1.0/setup.py
--- old/social-auth-app-django-2.1.0/setup.py 2017-01-01 15:37:05.000000000 +0100
+++ new/social-auth-app-django-3.1.0/setup.py 2018-08-20 15:43:51.000000000 +0200
@@ -34,7 +34,9 @@
url='https://github.com/python-social-auth/social-app-django',
packages=[
'social_django',
- 'social_django.migrations'
+ 'social_django.migrations',
+ 'social_django.management',
+ 'social_django.management.commands',
],
long_description=long_description(),
install_requires=load_requirements(),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/social_auth_app_django.egg-info/PKG-INFO new/social-auth-app-django-3.1.0/social_auth_app_django.egg-info/PKG-INFO
--- old/social-auth-app-django-2.1.0/social_auth_app_django.egg-info/PKG-INFO 2017-12-22 13:49:21.000000000 +0100
+++ new/social-auth-app-django-3.1.0/social_auth_app_django.egg-info/PKG-INFO 2018-10-31 15:46:24.000000000 +0100
@@ -1,16 +1,16 @@
Metadata-Version: 1.1
Name: social-auth-app-django
-Version: 2.1.0
+Version: 3.1.0
Summary: Python Social Authentication, Django integration.
Home-page: https://github.com/python-social-auth/social-app-django
Author: Matias Aguirre
Author-email: matiasaguirre@gmail.com
License: BSD
-Description-Content-Type: UNKNOWN
Description: # Python Social Auth - Django
[![Build Status](https://travis-ci.org/python-social-auth/social-app-django.svg?branch=master)](https://travis-ci.org/python-social-auth/social-app-django)
[![Donate](https://img.shields.io/badge/Donate-PayPal-orange.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=matiasaguirre%40gmail%2ecom&lc=US&item_name=Python%20Social%20Auth&no_note=0¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest)
+ [![PyPI version](https://badge.fury.io/py/social-auth-app-django.svg)](https://badge.fury.io/py/social-auth-app-django)
Python Social Auth is an easy to setup social authentication/registration
mechanism with support for several frameworks and auth providers.
@@ -54,7 +54,7 @@
## Donations
- This project is maintened on my spare time, consider donating to keep
+ This project is maintained on my spare time, consider donating to keep
it improving.
[![Donate](https://img.shields.io/badge/Donate-PayPal-orange.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=matiasaguirre%40gmail%2ecom&lc=US&item_name=Python%20Social%20Auth&no_note=0¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/social_django/__init__.py new/social-auth-app-django-3.1.0/social_django/__init__.py
--- old/social-auth-app-django-2.1.0/social_django/__init__.py 2017-12-22 13:46:23.000000000 +0100
+++ new/social-auth-app-django-3.1.0/social_django/__init__.py 2018-10-31 15:45:18.000000000 +0100
@@ -1,4 +1,4 @@
-__version__ = '2.1.0'
+__version__ = '3.1.0'
from social_core.backends.base import BaseAuth
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/social_django/compat.py new/social-auth-app-django-3.1.0/social_django/compat.py
--- old/social-auth-app-django-2.1.0/social_django/compat.py 2017-12-22 13:40:50.000000000 +0100
+++ new/social-auth-app-django-3.1.0/social_django/compat.py 2018-10-28 21:18:39.000000000 +0100
@@ -16,7 +16,7 @@
def get_rel_model(field):
- if django.VERSION >= (2, 0):
+ if django.VERSION >= (1, 9):
return field.remote_field.model
user_model = field.rel.to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/social_django/fields.py new/social-auth-app-django-3.1.0/social_django/fields.py
--- old/social-auth-app-django-2.1.0/social_django/fields.py 2017-12-22 13:38:26.000000000 +0100
+++ new/social-auth-app-django-3.1.0/social_django/fields.py 2018-10-31 15:41:57.000000000 +0100
@@ -1,35 +1,17 @@
import json
import six
-import functools
-
-import django
from django.core.exceptions import ValidationError
from django.conf import settings
from django.db import models
+from django.utils.encoding import force_text
from social_core.utils import setting_name
-try:
- from django.utils.encoding import smart_unicode as smart_text
- smart_text # placate pyflakes
-except ImportError:
- from django.utils.encoding import smart_text
-
-# SubfieldBase causes RemovedInDjango110Warning in 1.8 and 1.9, and
-# will not work in 1.10 or later
-if django.VERSION[:2] >= (1, 8):
- field_metaclass = type
-else:
- from django.db.models import SubfieldBase
- field_metaclass = SubfieldBase
-
-field_class = functools.partial(six.with_metaclass, field_metaclass)
-
if getattr(settings, setting_name('POSTGRES_JSONFIELD'), False):
from django.contrib.postgres.fields import JSONField as JSONFieldBase
else:
- JSONFieldBase = field_class(models.TextField)
+ JSONFieldBase = models.TextField
class JSONField(JSONFieldBase):
@@ -41,7 +23,7 @@
kwargs.setdefault('default', dict)
super(JSONField, self).__init__(*args, **kwargs)
- def from_db_value(self, value, expression, connection, context):
+ def from_db_value(self, value, *args, **kwargs):
return self.to_python(value)
def to_python(self, value):
@@ -56,10 +38,6 @@
value = six.text_type(value, 'utf-8')
if isinstance(value, six.string_types):
try:
- # with django 1.6 i have '"{}"' as default value here
- if value[0] == value[-1] == '"':
- value = value[1:-1]
-
return json.loads(value)
except Exception as err:
raise ValidationError(str(err))
@@ -85,10 +63,9 @@
def value_to_string(self, obj):
"""Return value from object converted to string properly"""
- return smart_text(self.value_from_object(obj))
+ return force_text(self.value_from_object(obj))
def value_from_object(self, obj):
"""Return value dumped to string."""
orig_val = super(JSONField, self).value_from_object(obj)
return self.get_prep_value(orig_val)
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/social_django/middleware.py new/social-auth-app-django-3.1.0/social_django/middleware.py
--- old/social-auth-app-django-2.1.0/social_django/middleware.py 2017-10-28 15:21:25.000000000 +0200
+++ new/social-auth-app-django-3.1.0/social_django/middleware.py 2018-08-20 15:43:51.000000000 +0200
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import six
+from django.apps import apps
from django.conf import settings
from django.contrib import messages
from django.contrib.messages.api import MessageFailure
@@ -33,17 +34,21 @@
backend_name = getattr(backend, 'name', 'unknown-backend')
message = self.get_message(request, exception)
- social_logger.error(message)
-
url = self.get_redirect_uri(request, exception)
- try:
- messages.error(request, message,
- extra_tags='social-auth ' + backend_name)
- except MessageFailure:
- if url:
- url += ('?' in url and '&' or '?') + \
- 'message={0}&backend={1}'.format(urlquote(message),
- backend_name)
+
+ if apps.is_installed('django.contrib.messages'):
+ social_logger.info(message)
+ try:
+ messages.error(request, message,
+ extra_tags='social-auth ' + backend_name)
+ except MessageFailure:
+ if url:
+ url += ('?' in url and '&' or '?') + \
+ 'message={0}&backend={1}'.format(urlquote(message),
+ backend_name)
+ else:
+ social_logger.error(message)
+
if url:
return redirect(url)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/social_django/storage.py new/social-auth-app-django-3.1.0/social_django/storage.py
--- old/social-auth-app-django-2.1.0/social_django/storage.py 2017-01-28 15:06:05.000000000 +0100
+++ new/social-auth-app-django-3.1.0/social_django/storage.py 2018-10-28 21:44:39.000000000 +0100
@@ -2,6 +2,7 @@
import base64
import six
import sys
+from django.core.exceptions import FieldDoesNotExist
from django.db import transaction
from django.db.utils import IntegrityError
@@ -58,8 +59,16 @@
@classmethod
def create_user(cls, *args, **kwargs):
username_field = cls.username_field()
- if 'username' in kwargs and username_field not in kwargs:
- kwargs[username_field] = kwargs.pop('username')
+ if 'username' in kwargs:
+ if username_field not in kwargs:
+ kwargs[username_field] = kwargs.pop('username')
+ else:
+ # If username_field is 'email' and there is no field named "username"
+ # then latest should be removed from kwargs.
+ try:
+ cls.user_model()._meta.get_field('username')
+ except FieldDoesNotExist:
+ kwargs.pop('username')
try:
if hasattr(transaction, 'atomic'):
# In Django versions that have an "atomic" transaction decorator / context
@@ -152,7 +161,11 @@
except cls.DoesNotExist:
assoc = cls(server_url=server_url,
handle=association.handle)
- assoc.secret = base64.encodestring(association.secret)
+
+ try:
+ assoc.secret = base64.encodebytes(association.secret).decode()
+ except AttributeError:
+ assoc.secret = base64.encodestring(association.secret).decode()
assoc.issued = association.issued
assoc.lifetime = association.lifetime
assoc.assoc_type = association.assoc_type
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/social_django/views.py new/social-auth-app-django-3.1.0/social_django/views.py
--- old/social-auth-app-django-2.1.0/social_django/views.py 2017-10-28 15:21:25.000000000 +0200
+++ new/social-auth-app-django-3.1.0/social_django/views.py 2018-10-28 21:12:02.000000000 +0100
@@ -28,7 +28,7 @@
@psa('{0}:complete'.format(NAMESPACE))
def complete(request, backend, *args, **kwargs):
"""Authentication complete view"""
- return do_complete(request.backend, _do_login, request.user,
+ return do_complete(request.backend, _do_login, user=request.user,
redirect_name=REDIRECT_FIELD_NAME, request=request,
*args, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/social-auth-app-django-2.1.0/tests/test_models.py new/social-auth-app-django-3.1.0/tests/test_models.py
--- old/social-auth-app-django-2.1.0/tests/test_models.py 2017-10-28 15:21:25.000000000 +0200
+++ new/social-auth-app-django-3.1.0/tests/test_models.py 2018-10-28 21:15:18.000000000 +0100
@@ -188,6 +188,7 @@
qs = Association.get(handle='a')
self.assertEqual(qs.count(), 1)
+ self.assertEqual(qs[0].secret, 'Yg==\n')
Association.remove(ids_to_delete=[qs.first().id])
self.assertEqual(Association.objects.count(), 0)