commit python-django-reversion for openSUSE:Factory
Hello community, here is the log from the commit of package python-django-reversion for openSUSE:Factory checked in at 2018-10-31 13:15:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-reversion (Old) and /work/SRC/openSUSE:Factory/.python-django-reversion.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-django-reversion" Wed Oct 31 13:15:25 2018 rev:4 rq:645378 version:3.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-reversion/python-django-reversion.changes 2018-07-21 10:25:26.614954237 +0200 +++ /work/SRC/openSUSE:Factory/.python-django-reversion.new/python-django-reversion.changes 2018-10-31 13:20:00.463137946 +0100 @@ -1,0 +2,9 @@ +Mon Oct 29 22:26:50 UTC 2018 - Martin Herkt <9+suse@cirno.systems> + +- Update to version 3.0.1: + * Added squashed migrations back in to allow older installations + to upgrade + * Fixed TypeError exception when accessing m2m_data attribute + from a field that points to Django’s User model + +------------------------------------------------------------------- Old: ---- django-reversion-3.0.0.tar.gz New: ---- django-reversion-3.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-reversion.spec ++++++ --- /var/tmp/diff_new_pack.sxbcRl/_old 2018-10-31 13:20:02.987135572 +0100 +++ /var/tmp/diff_new_pack.sxbcRl/_new 2018-10-31 13:20:03.003135558 +0100 @@ -12,13 +12,13 @@ # 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-django-reversion -Version: 3.0.0 +Version: 3.0.1 Release: 0 Summary: A Django extension that provides version control for model instances License: BSD-3-Clause ++++++ django-reversion-3.0.0.tar.gz -> django-reversion-3.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/CHANGELOG.rst new/django-reversion-3.0.1/CHANGELOG.rst --- old/django-reversion-3.0.0/CHANGELOG.rst 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/CHANGELOG.rst 2018-10-23 16:29:55.000000000 +0200 @@ -3,6 +3,14 @@ django-reversion changelog ========================== +3.0.1 - 23/10/2018 +------------------ + +- Added squashed migrations back in to allow older installations to upgrade (Christopher Thorne). +- Fixed TypeError exception when accessing m2m_data attribute from a field that points to Django’s User model + (@denisroldan). + + 3.0.0 - 19/07/2018 ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/PKG-INFO new/django-reversion-3.0.1/PKG-INFO --- old/django-reversion-3.0.0/PKG-INFO 2018-07-19 13:23:52.000000000 +0200 +++ new/django-reversion-3.0.1/PKG-INFO 2018-10-23 16:31:16.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: django-reversion -Version: 3.0.0 +Version: 3.0.1 Summary: An extension to the Django web framework that provides version control for model instances. Home-page: http://github.com/etianen/django-reversion Author: Dave Hall @@ -17,4 +17,5 @@ Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 Classifier: Framework :: Django diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/django_reversion.egg-info/PKG-INFO new/django-reversion-3.0.1/django_reversion.egg-info/PKG-INFO --- old/django-reversion-3.0.0/django_reversion.egg-info/PKG-INFO 2018-07-19 13:23:52.000000000 +0200 +++ new/django-reversion-3.0.1/django_reversion.egg-info/PKG-INFO 2018-10-23 16:31:16.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: django-reversion -Version: 3.0.0 +Version: 3.0.1 Summary: An extension to the Django web framework that provides version control for model instances. Home-page: http://github.com/etianen/django-reversion Author: Dave Hall @@ -17,4 +17,5 @@ Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 Classifier: Framework :: Django diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/django_reversion.egg-info/SOURCES.txt new/django-reversion-3.0.1/django_reversion.egg-info/SOURCES.txt --- old/django-reversion-3.0.0/django_reversion.egg-info/SOURCES.txt 2018-07-19 13:23:52.000000000 +0200 +++ new/django-reversion-3.0.1/django_reversion.egg-info/SOURCES.txt 2018-10-23 16:31:16.000000000 +0200 @@ -35,7 +35,6 @@ docs/_include/throws-revision-error.rst reversion/__init__.py reversion/admin.py -reversion/compat.py reversion/errors.py reversion/middleware.py reversion/models.py @@ -84,7 +83,11 @@ reversion/management/commands/__init__.py reversion/management/commands/createinitialrevisions.py reversion/management/commands/deleterevisions.py +reversion/migrations/0001_initial.py reversion/migrations/0001_squashed_0004_auto_20160611_1202.py +reversion/migrations/0002_auto_20141216_1509.py +reversion/migrations/0003_auto_20160601_1600.py +reversion/migrations/0004_auto_20160611_1202.py reversion/migrations/__init__.py reversion/templates/reversion/change_list.html reversion/templates/reversion/object_history.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/django_reversion.egg-info/requires.txt new/django-reversion-3.0.1/django_reversion.egg-info/requires.txt --- old/django-reversion-3.0.0/django_reversion.egg-info/requires.txt 2018-07-19 13:23:52.000000000 +0200 +++ new/django-reversion-3.0.1/django_reversion.egg-info/requires.txt 2018-10-23 16:31:16.000000000 +0200 @@ -1 +1 @@ -django>=1.8 +django>=1.11 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/docs/django-versions.rst new/django-reversion-3.0.1/docs/django-versions.rst --- old/django-reversion-3.0.0/docs/django-versions.rst 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/docs/django-versions.rst 2018-10-23 16:29:55.000000000 +0200 @@ -10,9 +10,8 @@ ============== ================= Django version Reversion release ============== ================= -1.8 - current 2.x -1.7 1.10.x -1.6 1.8.x +1.11+ 3.x +1.8 2.x ============== ================= .. Warning:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/__init__.py new/django-reversion-3.0.1/reversion/__init__.py --- old/django-reversion-3.0.0/reversion/__init__.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/reversion/__init__.py 2018-10-23 16:29:55.000000000 +0200 @@ -36,4 +36,4 @@ get_registered_models, ) -__version__ = VERSION = (3, 0, 0) +__version__ = VERSION = (3, 0, 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/admin.py new/django-reversion-3.0.1/reversion/admin.py --- old/django-reversion-3.0.0/reversion/admin.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/reversion/admin.py 2018-10-23 16:29:55.000000000 +0200 @@ -6,36 +6,22 @@ from django.contrib import admin, messages from django.contrib.admin import options from django.contrib.admin.utils import unquote, quote -try: - from django.contrib.contenttypes.admin import GenericInlineModelAdmin - from django.contrib.contenttypes.fields import GenericRelation -except ImportError: # Django < 1.9 pragma: no cover - from django.contrib.contenttypes.generic import GenericInlineModelAdmin, GenericRelation -try: - from django.urls import reverse -except ImportError: # Django < 1.10 pragma: no cover - from django.core.urlresolvers import reverse +from django.contrib.contenttypes.admin import GenericInlineModelAdmin +from django.contrib.contenttypes.fields import GenericRelation from django.core.exceptions import PermissionDenied, ImproperlyConfigured from django.shortcuts import get_object_or_404, render, redirect +from django.urls import reverse from django.utils.text import capfirst from django.utils.timezone import template_localtime from django.utils.translation import ugettext as _ from django.utils.encoding import force_text from django.utils.formats import localize -from reversion.compat import remote_field, remote_model from reversion.errors import RevertError from reversion.models import Version from reversion.revisions import is_active, register, is_registered, set_comment, create_revision, set_user from reversion.views import _RollBackRevisionView -def private_fields(meta): - try: - return meta.private_fields - except AttributeError: # Django < 1.10 pragma: no cover - return meta.virtual_fields - - class VersionAdmin(admin.ModelAdmin): object_history_template = "reversion/object_history.html" @@ -88,10 +74,7 @@ set_comment(json.dumps(change_message)) else: set_comment(change_message) - try: - super(VersionAdmin, self).log_addition(request, object, change_message) - except TypeError: # Django < 1.9 pragma: no cover - super(VersionAdmin, self).log_addition(request, object) + super(VersionAdmin, self).log_addition(request, object, change_message) def log_change(self, request, object, message): if is_active(): @@ -118,10 +101,10 @@ inline_model = inline.model ct_field = inline.ct_field fk_name = inline.ct_fk_field - for field in private_fields(self.model._meta): + for field in self.model._meta.private_fields: if ( isinstance(field, GenericRelation) and - remote_model(field) == inline_model and + field.remote_field.model == inline_model and field.object_id_field_name == fk_name and field.content_type_field_name == ct_field ): @@ -134,13 +117,13 @@ for field in inline_model._meta.get_fields(): if ( isinstance(field, (models.ForeignKey, models.OneToOneField)) and - issubclass(self.model, remote_model(field)) + issubclass(self.model, field.remote_field.model) ): fk_name = field.name break - if fk_name and not remote_field(inline_model._meta.get_field(fk_name)).is_hidden(): + if fk_name and not inline_model._meta.get_field(fk_name).remote_field.is_hidden(): field = inline_model._meta.get_field(fk_name) - accessor = remote_field(field).get_accessor_name() + accessor = field.remote_field.get_accessor_name() follow_field = accessor return inline_model, follow_field diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/compat.py new/django-reversion-3.0.1/reversion/compat.py --- old/django-reversion-3.0.0/reversion/compat.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/reversion/compat.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,17 +0,0 @@ -import django - - -def remote_field(field): - # remote_field is new in Django 1.9 - return field.remote_field if hasattr(field, 'remote_field') else field.rel - - -def remote_model(field): - # remote_field is new in Django 1.9 - return field.remote_field.model if hasattr(field, 'remote_field') else field.rel.to - - -def is_authenticated(user): - if django.VERSION < (1, 10): - return user.is_authenticated() - return user.is_authenticated diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/migrations/0001_initial.py new/django-reversion-3.0.1/reversion/migrations/0001_initial.py --- old/django-reversion-3.0.0/reversion/migrations/0001_initial.py 1970-01-01 01:00:00.000000000 +0100 +++ new/django-reversion-3.0.1/reversion/migrations/0001_initial.py 2018-10-23 16:29:55.000000000 +0200 @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('contenttypes', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Revision', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('manager_slug', models.CharField(default='default', max_length=200, db_index=True)), + ('date_created', models.DateTimeField(auto_now_add=True, help_text='The date and time this revision was created.', verbose_name='date created', db_index=True)), + ('comment', models.TextField(help_text='A text comment on this revision.', verbose_name='comment', blank=True)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to=settings.AUTH_USER_MODEL, help_text='The user who created this revision.', null=True, verbose_name='user')), + ], + options={ + "ordering": ("-pk",) + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Version', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('object_id', models.TextField(help_text='Primary key of the model under version control.')), + ('object_id_int', models.IntegerField(help_text="An indexed, integer version of the stored model's primary key, used for faster lookups.", null=True, db_index=True, blank=True)), + ('format', models.CharField(help_text='The serialization format used by this model.', max_length=255)), + ('serialized_data', models.TextField(help_text='The serialized form of this version of the model.')), + ('object_repr', models.TextField(help_text='A string representation of the object.')), + ('content_type', models.ForeignKey(help_text='Content type of the model under version control.', on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')), + ('revision', models.ForeignKey(help_text='The revision that contains this version.', on_delete=django.db.models.deletion.CASCADE, to='reversion.Revision')), + ], + options={ + "ordering": ("-pk",) + }, + bases=(models.Model,), + ), + ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py new/django-reversion-3.0.1/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py --- old/django-reversion-3.0.0/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py 2018-10-23 16:29:55.000000000 +0200 @@ -9,6 +9,8 @@ class Migration(migrations.Migration): + replaces = [('reversion', '0001_initial'), ('reversion', '0002_auto_20141216_1509'), ('reversion', '0003_auto_20160601_1600'), ('reversion', '0004_auto_20160611_1202')] + initial = True dependencies = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/migrations/0002_auto_20141216_1509.py new/django-reversion-3.0.1/reversion/migrations/0002_auto_20141216_1509.py --- old/django-reversion-3.0.0/reversion/migrations/0002_auto_20141216_1509.py 1970-01-01 01:00:00.000000000 +0100 +++ new/django-reversion-3.0.1/reversion/migrations/0002_auto_20141216_1509.py 2018-10-23 16:29:55.000000000 +0200 @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('reversion', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='revision', + name='manager_slug', + field=models.CharField(default='default', max_length=191, db_index=True), + ), + ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/migrations/0003_auto_20160601_1600.py new/django-reversion-3.0.1/reversion/migrations/0003_auto_20160601_1600.py --- old/django-reversion-3.0.0/reversion/migrations/0003_auto_20160601_1600.py 1970-01-01 01:00:00.000000000 +0100 +++ new/django-reversion-3.0.1/reversion/migrations/0003_auto_20160601_1600.py 2018-10-23 16:29:55.000000000 +0200 @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-01 16:00 +from __future__ import unicode_literals + +from collections import defaultdict +from django.db import DEFAULT_DB_ALIAS, migrations, models, router +from django.apps import apps as live_apps + + +def de_dupe_version_table(apps, schema_editor): + """ + Removes some duplicate Version models that may have crept into the database and will prevent the + unique index being added by migration 0004. + """ + db_alias = schema_editor.connection.alias + Version = apps.get_model("reversion", "Version") + keep_version_ids = Version.objects.using(db_alias).order_by().values_list( + # Group by the unique constraint we intend to enforce. + "revision_id", + "content_type_id", + "object_id", + ).annotate( + # Add in the most recent id for each duplicate row. + max_pk=models.Max("pk"), + ).values_list("max_pk", flat=True) + # Do not do anything if we're keeping all ids anyway. + if keep_version_ids.count() == Version.objects.using(db_alias).all().count(): + return + # Delete all duplicate versions. Can't do this as a delete with subquery because MySQL doesn't like running a + # subquery on the table being updated/deleted. + delete_version_ids = list(Version.objects.using(db_alias).exclude( + pk__in=keep_version_ids, + ).values_list("pk", flat=True)) + Version.objects.using(db_alias).filter( + pk__in=delete_version_ids, + ).delete() + + +def set_version_db(apps, schema_editor): + """ + Updates the db field in all Version models to point to the correct write + db for the model. + """ + db_alias = schema_editor.connection.alias + Version = apps.get_model("reversion", "Version") + content_types = Version.objects.using(db_alias).order_by().values_list( + "content_type_id", + "content_type__app_label", + "content_type__model" + ).distinct() + model_dbs = defaultdict(list) + for content_type_id, app_label, model_name in content_types: + # We need to be able to access all models in the project, and we can't + # specify them up-front in the migration dependencies. So we have to + # just get the live model. This should be fine, since we don't actually + # manipulate the live model in any way. + try: + model = live_apps.get_model(app_label, model_name) + except LookupError: + # If the model appears not to exist, play it safe and use the default db. + db = "default" + else: + db = router.db_for_write(model) + model_dbs[db].append(content_type_id) + # Update db field. + # speedup for case when there is only default db + if DEFAULT_DB_ALIAS in model_dbs and len(model_dbs) == 1: + Version.objects.using(db_alias).update(db=DEFAULT_DB_ALIAS) + else: + for db, content_type_ids in model_dbs.items(): + Version.objects.using(db_alias).filter( + content_type__in=content_type_ids + ).update(db=db) + + +class Migration(migrations.Migration): + + dependencies = [ + ('reversion', '0002_auto_20141216_1509'), + ] + + operations = [ + migrations.RemoveField( + model_name='revision', + name='manager_slug', + ), + migrations.RemoveField( + model_name='version', + name='object_id_int', + ), + migrations.AlterField( + model_name='version', + name='object_id', + field=models.CharField(help_text='Primary key of the model under version control.', max_length=191), + ), + migrations.AlterField( + model_name='revision', + name='date_created', + field=models.DateTimeField(db_index=True, help_text='The date and time this revision was created.', verbose_name='date created'), + ), + migrations.AddField( + model_name='version', + name='db', + field=models.CharField(null=True, help_text='The database the model under version control is stored in.', max_length=191), + ), + migrations.RunPython(de_dupe_version_table), + migrations.RunPython(set_version_db), + ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/migrations/0004_auto_20160611_1202.py new/django-reversion-3.0.1/reversion/migrations/0004_auto_20160611_1202.py --- old/django-reversion-3.0.0/reversion/migrations/0004_auto_20160611_1202.py 1970-01-01 01:00:00.000000000 +0100 +++ new/django-reversion-3.0.1/reversion/migrations/0004_auto_20160611_1202.py 2018-10-23 16:29:55.000000000 +0200 @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-06-11 12:02 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('reversion', '0003_auto_20160601_1600'), + ] + + operations = [ + migrations.AlterField( + model_name='version', + name='db', + field=models.CharField(help_text='The database the model under version control is stored in.', max_length=191), + ), + migrations.AlterUniqueTogether( + name='version', + unique_together=set([('db', 'content_type', 'object_id', 'revision')]), + ), + ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/models.py new/django-reversion-3.0.1/reversion/models.py --- old/django-reversion-3.0.0/reversion/models.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/reversion/models.py 2018-10-23 16:29:55.000000000 +0200 @@ -1,11 +1,8 @@ from __future__ import unicode_literals from collections import defaultdict from itertools import chain, groupby +from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType -try: - from django.contrib.contenttypes.fields import GenericForeignKey -except ImportError: # Django < 1.9 pragma: no cover - from django.contrib.contenttypes.generic import GenericForeignKey from django.conf import settings from django.contrib.admin.models import LogEntry from django.core import serializers @@ -64,12 +61,7 @@ ) def get_comment(self): - try: - return LogEntry(change_message=self.comment).get_change_message() - except AttributeError: - # Django < 1.10 - # LogEntry dont have `.get_change_message()` - return self.comment + return LogEntry(change_message=self.comment).get_change_message() def revert(self, delete=False): # Group the models by the database of the serialized model. @@ -278,7 +270,7 @@ field = model._meta.get_field(field_name) if isinstance(field, models.ManyToManyField): # M2M fields with a custom through are not stored in m2m_data, but as a separate model. - if field.attname in object_version.m2m_data: + if object_version.m2m_data and field.attname in object_version.m2m_data: field_dict[field.attname] = object_version.m2m_data[field.attname] else: field_dict[field.attname] = getattr(obj, field.attname) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/revisions.py new/django-reversion-3.0.1/reversion/revisions.py --- old/django-reversion-3.0.0/reversion/revisions.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/reversion/revisions.py 2018-10-23 16:29:55.000000000 +0200 @@ -11,7 +11,6 @@ from django.db.models.signals import post_save, m2m_changed from django.utils.encoding import force_text from django.utils import timezone, six -from reversion.compat import remote_field from reversion.errors import RevisionManagementError, RegistrationError from reversion.signals import pre_revision_commit, post_revision_commit @@ -355,7 +354,7 @@ yield model, post_save, _post_save_receiver opts = model._meta.concrete_model._meta for field in opts.local_many_to_many: - m2m_model = remote_field(field).through + m2m_model = field.remote_field.through if isinstance(m2m_model, six.string_types): if "." not in m2m_model: m2m_model = "{app_label}.{m2m_model}".format( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/reversion/views.py new/django-reversion-3.0.1/reversion/views.py --- old/django-reversion-3.0.0/reversion/views.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/reversion/views.py 2018-10-23 16:29:55.000000000 +0200 @@ -1,6 +1,5 @@ from functools import wraps -from reversion.compat import is_authenticated from reversion.revisions import create_revision as create_revision_base, set_user, get_user @@ -15,7 +14,7 @@ def _set_user_from_request(request): - if getattr(request, "user", None) and is_authenticated(request.user) and get_user() is None: + if getattr(request, "user", None) and request.user.is_authenticated and get_user() is None: set_user(request.user) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/setup.py new/django-reversion-3.0.1/setup.py --- old/django-reversion-3.0.0/setup.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/setup.py 2018-10-23 16:29:55.000000000 +0200 @@ -28,7 +28,7 @@ "reversion": ["locale/*/LC_MESSAGES/django.*", "templates/reversion/*.html"]}, cmdclass=cmdclass, install_requires=[ - "django>=1.8", + "django>=1.11", ], classifiers=[ "Development Status :: 5 - Production/Stable", @@ -40,6 +40,7 @@ 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', "Framework :: Django", ] ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/tests/test_app/models.py new/django-reversion-3.0.1/tests/test_app/models.py --- old/django-reversion-3.0.0/tests/test_app/models.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/tests/test_app/models.py 2018-10-23 16:29:55.000000000 +0200 @@ -1,9 +1,6 @@ from django.db import models +from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.models import ContentType -try: - from django.contrib.contenttypes.fields import GenericRelation -except ImportError: # Django < 1.9 pragma: no cover - from django.contrib.contenttypes.generic import GenericRelation from reversion.models import Revision diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/tests/test_app/tests/base.py new/django-reversion-3.0.1/tests/test_app/tests/base.py --- old/django-reversion-3.0.0/tests/test_app/tests/base.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/tests/test_app/tests/base.py 2018-10-23 16:29:55.000000000 +0200 @@ -2,10 +2,7 @@ from django.conf import settings from django.contrib.auth.models import User from django.core.management import call_command -try: - from django.urls import clear_url_caches -except ImportError: # Django < 1.10 pragma: no cover - from django.core.urlresolvers import clear_url_caches +from django.urls import clear_url_caches from django.test import TestCase, TransactionTestCase from django.test.utils import override_settings from django.utils import timezone diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-reversion-3.0.0/tests/test_app/tests/test_admin.py new/django-reversion-3.0.1/tests/test_app/tests/test_admin.py --- old/django-reversion-3.0.0/tests/test_app/tests/test_admin.py 2018-07-19 13:22:54.000000000 +0200 +++ new/django-reversion-3.0.1/tests/test_app/tests/test_admin.py 2018-10-23 16:29:55.000000000 +0200 @@ -1,9 +1,6 @@ import re from django.contrib import admin -try: - from django.contrib.contenttypes.admin import GenericTabularInline -except ImportError: # Django < 1.9 pragma: no cover - from django.contrib.contenttypes.generic import GenericTabularInline +from django.contrib.contenttypes.admin import GenericTabularInline from django.shortcuts import resolve_url import reversion from reversion.admin import VersionAdmin
participants (1)
-
root