Hello community,
here is the log from the commit of package python-django-reversion for
openSUSE:Factory checked in at 2020-02-20 14:59:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-reversion (Old)
and /work/SRC/openSUSE:Factory/.python-django-reversion.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-reversion"
Thu Feb 20 14:59:29 2020 rev:12 rq:777600 version:3.0.7
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-django-reversion/python-django-reversion.changes
2019-12-07 15:07:27.483863225 +0100
+++
/work/SRC/openSUSE:Factory/.python-django-reversion.new.26092/python-django-reversion.changes
2020-02-20 14:59:31.378775770 +0100
@@ -1,0 +2,10 @@
+Thu Feb 20 08:55:04 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Update to 3.0.7:
+ * Packaging improvements (@michael-k).
+ * Removing deprecated usages of force_text (@Tenzer).
+ * Documentation fixes (@chicheng).
+ * Removing deprecated usages of ugettext_lazy (@François GUÉRIN).
+ * Slovenian translation (@Bor Plestenjak).
+
+-------------------------------------------------------------------
Old:
----
django-reversion-3.0.5.tar.gz
New:
----
django-reversion-3.0.7.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-django-reversion.spec ++++++
--- /var/tmp/diff_new_pack.vJb2zY/_old 2020-02-20 14:59:31.926776845 +0100
+++ /var/tmp/diff_new_pack.vJb2zY/_new 2020-02-20 14:59:31.926776845 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-django-reversion
#
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,11 +19,11 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-django-reversion
-Version: 3.0.5
+Version: 3.0.7
Release: 0
Summary: A Django extension that provides version control for model
instances
License: BSD-3-Clause
-URL: http://github.com/etianen/django-reversion
+URL: https://github.com/etianen/django-reversion
Source:
https://files.pythonhosted.org/packages/source/d/django-reversion/django-reversion-%{version}.tar.gz
BuildRequires: %{python_module Django > 1.11}
BuildRequires: %{python_module mysqlclient}
++++++ django-reversion-3.0.5.tar.gz -> django-reversion-3.0.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-reversion-3.0.5/CHANGELOG.rst
new/django-reversion-3.0.7/CHANGELOG.rst
--- old/django-reversion-3.0.5/CHANGELOG.rst 2019-12-02 19:23:48.000000000
+0100
+++ new/django-reversion-3.0.7/CHANGELOG.rst 2020-02-17 16:16:23.000000000
+0100
@@ -3,11 +3,27 @@
django-reversion changelog
==========================
+3.0.7 - 17/02/2010
+------------------
+
+- Removing deprecated usages of `ugettest_lazy` (@François GUÉRIN).
+- Slovenian translation (@Bor Plestenjak).
+
+
+3.0.6 - 17/02/2020
+------------------
+
+- Packaging improvements (@michael-k).
+- Removing deprecated usages of `force_text` (@Tenzer).
+- Documentation fixes (@chicheng).
+
+
3.0.5 - 02/12/2019
+------------------
- Improved performance of `get_deleted` for large datasets (@jeremy-engel).
- Django 3.0 compatibility (@claudep).
-- Drops Django <= 1.11 compatibility (@claudep).
+- Drops Django < 1.11 compatibility (@claudep).
- Fixed errors in manageement commands when `django.contrib.admin` is not in
`INSTALLED_APPS` (@irtimir).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-reversion-3.0.5/PKG-INFO
new/django-reversion-3.0.7/PKG-INFO
--- old/django-reversion-3.0.5/PKG-INFO 2019-12-02 19:24:32.000000000 +0100
+++ new/django-reversion-3.0.7/PKG-INFO 2020-02-17 16:17:12.000000000 +0100
@@ -1,12 +1,93 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: django-reversion
-Version: 3.0.5
+Version: 3.0.7
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
Author-email: [email protected]
License: BSD
-Description: UNKNOWN
+Description: ================
+ django-reversion
+ ================
+
+ |PyPI latest| |PyPI Version| |PyPI License| |TravisCI| |Docs|
+
+
+ **django-reversion** is an extension to the Django web framework that
provides
+ version control for model instances.
+
+ Requirements
+ ============
+
+ - Python 3.6 or later
+ - Django 1.11 or later
+
+ Features
+ ========
+
+ - Roll back to any point in a model instance's history.
+ - Recover deleted model instances.
+ - Simple admin integration.
+
+ Documentation
+ =============
+
+ Check out the latest ``django-reversion`` documentation at `Getting
Started <http://django-reversion.readthedocs.io/>`_
+
+
+ Issue tracking and source code can be found at the
+ `main project website <http://github.com/etianen/django-reversion>`_.
+
+ You can keep up to date with the latest announcements by joining the
+ `django-reversion discussion group
<http://groups.google.com/group/django-reversion>`_.
+
+ Upgrading
+ =========
+
+ Please check the `Changelog
<https://github.com/etianen/django-reversion/blob/master/CHANGELOG.rst>`_
before upgrading
+ your installation of django-reversion.
+
+ Contributing
+ ============
+
+ Bug reports, bug fixes, and new features are always welcome. Please
raise issues on the
+ `django-reversion project site
<http://github.com/etianen/django-reversion>`_, and submit
+ pull requests for any new code.
+
+ 1. Fork the `repository <http://github.com/etianen/django-reversion>`_
on GitHub.
+ 2. Make a branch off of master and commit your changes to it.
+ 3. Install requirements.
+
+ .. code:: bash
+
+ $ pip install django psycopg2 mysqlclient -e .
+
+ 4. Run the tests
+
+ .. code:: bash
+
+ $ tests/manage.py test tests
+
+ 5. Create a Pull Request with your contribution
+
+ Contributors
+ ============
+
+ The django-reversion project was developed by `Dave Hall
<http://www.etianen.com/>`_ and contributed
+ to by `many other people
<https://github.com/etianen/django-reversion/graphs/contributors>`_.
+
+
+ .. |Docs| image::
https://readthedocs.org/projects/django-reversion/badge/?version=latest
+ :target:
http://django-reversion.readthedocs.org/en/latest/?badge=latest
+ .. |PyPI Version| image::
https://img.shields.io/pypi/pyversions/django-reversion.svg?maxAge=60
+ :target: https://pypi.python.org/pypi/django-reversion
+ .. |PyPI License| image::
https://img.shields.io/pypi/l/django-reversion.svg?maxAge=120
+ :target:
https://github.com/rhenter/django-reversion/blob/master/LICENSE
+ .. |PyPI latest| image::
https://img.shields.io/pypi/v/django-reversion.svg?maxAge=120
+ :target: https://pypi.python.org/pypi/django-reversion
+ .. |TravisCI| image::
https://travis-ci.org/etianen/django-reversion.svg?branch=master
+ :target: https://travis-ci.org/etianen/django-reversion
+
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
@@ -18,3 +99,4 @@
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Framework :: Django
+Requires-Python: >=3.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-reversion-3.0.5/README.rst
new/django-reversion-3.0.7/README.rst
--- old/django-reversion-3.0.5/README.rst 2019-12-02 19:23:48.000000000
+0100
+++ new/django-reversion-3.0.7/README.rst 2020-02-17 16:16:23.000000000
+0100
@@ -11,7 +11,7 @@
Requirements
============
-- Python 3.5 or later
+- Python 3.6 or later
- Django 1.11 or later
Features
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-reversion-3.0.5/django_reversion.egg-info/PKG-INFO
new/django-reversion-3.0.7/django_reversion.egg-info/PKG-INFO
--- old/django-reversion-3.0.5/django_reversion.egg-info/PKG-INFO
2019-12-02 19:24:32.000000000 +0100
+++ new/django-reversion-3.0.7/django_reversion.egg-info/PKG-INFO
2020-02-17 16:17:12.000000000 +0100
@@ -1,12 +1,93 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: django-reversion
-Version: 3.0.5
+Version: 3.0.7
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
Author-email: [email protected]
License: BSD
-Description: UNKNOWN
+Description: ================
+ django-reversion
+ ================
+
+ |PyPI latest| |PyPI Version| |PyPI License| |TravisCI| |Docs|
+
+
+ **django-reversion** is an extension to the Django web framework that
provides
+ version control for model instances.
+
+ Requirements
+ ============
+
+ - Python 3.6 or later
+ - Django 1.11 or later
+
+ Features
+ ========
+
+ - Roll back to any point in a model instance's history.
+ - Recover deleted model instances.
+ - Simple admin integration.
+
+ Documentation
+ =============
+
+ Check out the latest ``django-reversion`` documentation at `Getting
Started <http://django-reversion.readthedocs.io/>`_
+
+
+ Issue tracking and source code can be found at the
+ `main project website <http://github.com/etianen/django-reversion>`_.
+
+ You can keep up to date with the latest announcements by joining the
+ `django-reversion discussion group
<http://groups.google.com/group/django-reversion>`_.
+
+ Upgrading
+ =========
+
+ Please check the `Changelog
<https://github.com/etianen/django-reversion/blob/master/CHANGELOG.rst>`_
before upgrading
+ your installation of django-reversion.
+
+ Contributing
+ ============
+
+ Bug reports, bug fixes, and new features are always welcome. Please
raise issues on the
+ `django-reversion project site
<http://github.com/etianen/django-reversion>`_, and submit
+ pull requests for any new code.
+
+ 1. Fork the `repository <http://github.com/etianen/django-reversion>`_
on GitHub.
+ 2. Make a branch off of master and commit your changes to it.
+ 3. Install requirements.
+
+ .. code:: bash
+
+ $ pip install django psycopg2 mysqlclient -e .
+
+ 4. Run the tests
+
+ .. code:: bash
+
+ $ tests/manage.py test tests
+
+ 5. Create a Pull Request with your contribution
+
+ Contributors
+ ============
+
+ The django-reversion project was developed by `Dave Hall
<http://www.etianen.com/>`_ and contributed
+ to by `many other people
<https://github.com/etianen/django-reversion/graphs/contributors>`_.
+
+
+ .. |Docs| image::
https://readthedocs.org/projects/django-reversion/badge/?version=latest
+ :target:
http://django-reversion.readthedocs.org/en/latest/?badge=latest
+ .. |PyPI Version| image::
https://img.shields.io/pypi/pyversions/django-reversion.svg?maxAge=60
+ :target: https://pypi.python.org/pypi/django-reversion
+ .. |PyPI License| image::
https://img.shields.io/pypi/l/django-reversion.svg?maxAge=120
+ :target:
https://github.com/rhenter/django-reversion/blob/master/LICENSE
+ .. |PyPI latest| image::
https://img.shields.io/pypi/v/django-reversion.svg?maxAge=120
+ :target: https://pypi.python.org/pypi/django-reversion
+ .. |TravisCI| image::
https://travis-ci.org/etianen/django-reversion.svg?branch=master
+ :target: https://travis-ci.org/etianen/django-reversion
+
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
@@ -18,3 +99,4 @@
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Framework :: Django
+Requires-Python: >=3.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-reversion-3.0.5/django_reversion.egg-info/SOURCES.txt
new/django-reversion-3.0.7/django_reversion.egg-info/SOURCES.txt
--- old/django-reversion-3.0.5/django_reversion.egg-info/SOURCES.txt
2019-12-02 19:24:32.000000000 +0100
+++ new/django-reversion-3.0.7/django_reversion.egg-info/SOURCES.txt
2020-02-17 16:17:12.000000000 +0100
@@ -70,6 +70,8 @@
reversion/locale/ru/LC_MESSAGES/django.po
reversion/locale/sk/LC_MESSAGES/django.mo
reversion/locale/sk/LC_MESSAGES/django.po
+reversion/locale/sl_SI/LC_MESSAGES/django.mo
+reversion/locale/sl_SI/LC_MESSAGES/django.po
reversion/locale/sv/LC_MESSAGES/django.mo
reversion/locale/sv/LC_MESSAGES/django.po
reversion/locale/uk/LC_MESSAGES/django.mo
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-reversion-3.0.5/reversion/__init__.py
new/django-reversion-3.0.7/reversion/__init__.py
--- old/django-reversion-3.0.5/reversion/__init__.py 2019-12-02
19:23:48.000000000 +0100
+++ new/django-reversion-3.0.7/reversion/__init__.py 2020-02-17
16:16:23.000000000 +0100
@@ -36,4 +36,4 @@
get_registered_models,
)
-__version__ = VERSION = (3, 0, 5)
+__version__ = VERSION = (3, 0, 7)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-reversion-3.0.5/reversion/admin.py
new/django-reversion-3.0.7/reversion/admin.py
--- old/django-reversion-3.0.5/reversion/admin.py 2019-12-02
19:23:48.000000000 +0100
+++ new/django-reversion-3.0.7/reversion/admin.py 2020-02-17
16:16:23.000000000 +0100
@@ -12,7 +12,7 @@
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.encoding import force_str
from django.utils.formats import localize
from reversion.errors import RevertError
from reversion.models import Version
@@ -174,9 +174,9 @@
response.template_name = template_name # Set the
template name to the correct template.
response.render() # Eagerly render the response, so
it's using the latest version.
raise _RollBackRevisionView(response) # Raise
exception to undo the transaction and revision.
- except RevertError as ex:
+ except (RevertError, models.ProtectedError) as ex:
opts = self.model._meta
- messages.error(request, force_text(ex))
+ messages.error(request, force_str(ex))
return redirect("{}:{}_{}_changelist".format(self.admin_site.name,
opts.app_label, opts.model_name))
except _RollBackRevisionView as ex:
return ex.response
@@ -242,7 +242,7 @@
opts=opts,
app_label=opts.app_label,
module_name=capfirst(opts.verbose_name),
- title=_("Recover deleted %(name)s") % {"name":
force_text(opts.verbose_name_plural)},
+ title=_("Recover deleted %(name)s") % {"name":
force_str(opts.verbose_name_plural)},
deleted=deleted,
)
context.update(extra_context or {})
Binary files
old/django-reversion-3.0.5/reversion/locale/sl_SI/LC_MESSAGES/django.mo and
new/django-reversion-3.0.7/reversion/locale/sl_SI/LC_MESSAGES/django.mo differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-reversion-3.0.5/reversion/locale/sl_SI/LC_MESSAGES/django.po
new/django-reversion-3.0.7/reversion/locale/sl_SI/LC_MESSAGES/django.po
--- old/django-reversion-3.0.5/reversion/locale/sl_SI/LC_MESSAGES/django.po
1970-01-01 01:00:00.000000000 +0100
+++ new/django-reversion-3.0.7/reversion/locale/sl_SI/LC_MESSAGES/django.po
2020-02-17 16:16:23.000000000 +0100
@@ -0,0 +1,129 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-02-07 23:25+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Bor Plestenjak <[email protected]>\n"
+"Language-Team: LANGUAGE <[email protected]>\n"
+"Language: sl_SI\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: admin.py:66
+msgid "Initial version."
+msgstr "Začetna različica."
+
+#: admin.py:170
+#, python-format
+msgid "Reverted to previous version, saved on %(datetime)s"
+msgstr "Povrnjeno na prejšnjo različico, shranjeno %(datetime)s"
+
+#: admin.py:194
+#, python-format
+msgid "Recover %(name)s"
+msgstr "Obnovi %(name)s"
+
+#: admin.py:210
+#, python-format
+msgid "Revert %(name)s"
+msgstr "Povrni prejšnjo različico %(name)s"
+
+#: admin.py:245 templates/reversion/change_list.html:7
+#: templates/reversion/recover_form.html:10
+#: templates/reversion/recover_list.html:10
+#, python-format
+msgid "Recover deleted %(name)s"
+msgstr "Obnovi izbrisane %(name)s"
+
+#: models.py:33
+#, python-format
+msgid "Could not save %(object_repr)s version - missing dependency."
+msgstr "Različice %(object_repr)s ni bilo možno shraniti zaradi manjkajočih
odvisnosti."
+
+#: models.py:46
+msgid "date created"
+msgstr "datum nastanka"
+
+#: models.py:55
+msgid "user"
+msgstr "uporabnik"
+
+#: models.py:61
+msgid "comment"
+msgstr "opomba"
+
+#: models.py:233
+#, python-format
+msgid "Could not load %(object_repr)s version - incompatible version data."
+msgstr "Različice %(object_repr)s ni bilo možno naložiti zaradi nezdružljivih
podatkov."
+
+#: models.py:237
+#, python-format
+msgid "Could not load %(object_repr)s version - unknown serializer %(format)s."
+msgstr "Različice %(object_repr)s ni bilo možno naložiti zaradi neznane
serializacije %(format)s."
+
+#: templates/reversion/object_history.html:8
+msgid ""
+"Choose a date from the list below to revert to a previous version of this "
+"object."
+msgstr "Za povrnitev objekta na prejšnjo različico izberi datum iz spodnjega
seznama."
+
+#: templates/reversion/object_history.html:15
+#: templates/reversion/recover_list.html:23
+msgid "Date/time"
+msgstr "Datum/čas"
+
+#: templates/reversion/object_history.html:16
+msgid "User"
+msgstr "Uporabnik"
+
+#: templates/reversion/object_history.html:17
+msgid "Action"
+msgstr "Dejanje"
+
+#: templates/reversion/object_history.html:38
+msgid ""
+"This object doesn't have a change history. It probably wasn't added via this "
+"admin site."
+msgstr "Ta objekt nima zgodovine sprememb. Verjetno ni bil dodan preko te
strani za administracijo."
+
+#: templates/reversion/recover_form.html:7
+#: templates/reversion/recover_list.html:7
+#: templates/reversion/revision_form.html:7
+msgid "Home"
+msgstr "Domov"
+
+#: templates/reversion/recover_form.html:20
+msgid "Press the save button below to recover this version of the object."
+msgstr "Za obnovitev te različice objekta spodaj pritisni gumb shrani."
+
+#: templates/reversion/recover_list.html:17
+msgid ""
+"Choose a date from the list below to recover a deleted version of an object."
+msgstr "Za obnovitev izbrisanega objekta izberi datum iz spodnjega seznama."
+
+#: templates/reversion/recover_list.html:37
+msgid "There are no deleted objects to recover."
+msgstr "Ni izbrisanih objektov za obnovitev."
+
+#: templates/reversion/revision_form.html:11
+msgid "History"
+msgstr "Zgodovina"
+
+#: templates/reversion/revision_form.html:12
+#, python-format
+msgid "Revert %(verbose_name)s"
+msgstr "Povrni %(verbose_name)s"
+
+#: templates/reversion/revision_form.html:21
+msgid "Press the save button below to revert to this version of the object."
+msgstr "Za povrnitev te različice objekta spodaj pritisni gumb shrani."
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-reversion-3.0.5/reversion/models.py
new/django-reversion-3.0.7/reversion/models.py
--- old/django-reversion-3.0.5/reversion/models.py 2019-12-02
19:23:48.000000000 +0100
+++ new/django-reversion-3.0.7/reversion/models.py 2020-02-17
16:16:23.000000000 +0100
@@ -11,10 +11,10 @@
from django.db import IntegrityError, connections, models, router, transaction
from django.db.models.deletion import Collector
from django.db.models.functions import Cast
-from django.utils.encoding import force_text
+from django.utils.encoding import force_str
from django.utils.functional import cached_property
from django.utils.translation import ugettext
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
from reversion.errors import RevertError
from reversion.revisions import (_follow_relations_recursive,
@@ -104,7 +104,7 @@
_safe_revert(versions)
def __str__(self):
- return ", ".join(force_text(version) for version in
self.version_set.all())
+ return ", ".join(force_str(version) for version in
self.version_set.all())
class Meta:
app_label = "reversion"
@@ -226,7 +226,7 @@
@cached_property
def _object_version(self):
data = self.serialized_data
- data = force_text(data.encode("utf8"))
+ data = force_str(data.encode("utf8"))
try:
return list(serializers.deserialize(self.format, data,
ignorenonexistent=True))[0]
except DeserializationError:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-reversion-3.0.5/reversion/revisions.py
new/django-reversion-3.0.7/reversion/revisions.py
--- old/django-reversion-3.0.5/reversion/revisions.py 2019-12-02
19:23:48.000000000 +0100
+++ new/django-reversion-3.0.7/reversion/revisions.py 2020-02-17
16:16:23.000000000 +0100
@@ -8,7 +8,7 @@
from django.db import models, transaction, router
from django.db.models.query import QuerySet
from django.db.models.signals import post_save, m2m_changed
-from django.utils.encoding import force_text
+from django.utils.encoding import force_str
from django.utils import timezone
from reversion.errors import RevisionManagementError, RegistrationError
from reversion.signals import pre_revision_commit, post_revision_commit
@@ -173,7 +173,7 @@
return
version_options = _get_options(obj.__class__)
content_type = _get_content_type(obj.__class__, using)
- object_id = force_text(obj.pk)
+ object_id = force_str(obj.pk)
version_key = (content_type, object_id)
# If the obj is already in the revision, stop now.
db_versions = _current_frame().db_versions
@@ -191,7 +191,7 @@
(obj,),
fields=version_options.fields,
),
- object_repr=force_text(obj),
+ object_repr=force_str(obj),
)
# If the version is a duplicate, stop now.
if version_options.ignore_duplicates and explicit:
@@ -223,7 +223,7 @@
model_db_existing_pks = {
model: {
db: frozenset(map(
- force_text,
+ force_str,
model._base_manager.using(db).filter(pk__in=pks).values_list("pk", flat=True),
))
for db, pks in db_pks.items()
@@ -276,10 +276,10 @@
@contextmanager
def _create_revision_context(manage_manually, using, atomic):
- _push_frame(manage_manually, using)
- try:
- context = transaction.atomic(using=using) if atomic else
_dummy_context()
- with context:
+ context = transaction.atomic(using=using) if atomic else _dummy_context()
+ with context:
+ _push_frame(manage_manually, using)
+ try:
yield
# Only save for a db if that's the last stack frame for that db.
if not any(using in frame.db_versions for frame in
_local.stack[:-1]):
@@ -292,8 +292,8 @@
date_created=current_frame.date_created,
using=using,
)
- finally:
- _pop_frame()
+ finally:
+ _pop_frame()
def create_revision(manage_manually=False, using=None, atomic=True):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-reversion-3.0.5/setup.cfg
new/django-reversion-3.0.7/setup.cfg
--- old/django-reversion-3.0.5/setup.cfg 2019-12-02 19:24:32.000000000
+0100
+++ new/django-reversion-3.0.7/setup.cfg 2020-02-17 16:17:12.000000000
+0100
@@ -1,6 +1,3 @@
-[bdist_wheel]
-universal = 1
-
[flake8]
max-line-length = 120
exclude = venv,migrations
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django-reversion-3.0.5/setup.py
new/django-reversion-3.0.7/setup.py
--- old/django-reversion-3.0.5/setup.py 2019-12-02 19:23:48.000000000 +0100
+++ new/django-reversion-3.0.7/setup.py 2020-02-17 16:16:23.000000000 +0100
@@ -14,11 +14,18 @@
except ImportError:
cmdclass = {}
+
+def read(filepath):
+ with open(filepath, "r", encoding="utf-8") as f:
+ return f.read()
+
+
setup(
name="django-reversion",
version='.'.join(str(x) for x in __version__),
license="BSD",
description="An extension to the Django web framework that provides
version control for model instances.",
+ long_description=read('README.rst'),
author="Dave Hall",
author_email="[email protected]",
url="http://github.com/etianen/django-reversion",
@@ -30,6 +37,7 @@
install_requires=[
"django>=1.11",
],
+ python_requires='>=3.6',
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django-reversion-3.0.5/tests/test_app/tests/test_api.py
new/django-reversion-3.0.7/tests/test_app/tests/test_api.py
--- old/django-reversion-3.0.5/tests/test_app/tests/test_api.py 2019-12-02
19:23:48.000000000 +0100
+++ new/django-reversion-3.0.7/tests/test_app/tests/test_api.py 2020-02-17
16:16:23.000000000 +0100
@@ -139,6 +139,24 @@
with reversion.create_revision(atomic=False):
self.assertFalse(get_connection().in_atomic_block)
+ def testCreateRevisionInOnCommitHandler(self):
+ from django.db import transaction
+ from reversion.models import Revision
+
+ self.assertEqual(Revision.objects.all().count(), 0)
+
+ with reversion.create_revision(atomic=True):
+ model = TestModel.objects.create()
+
+ def on_commit():
+ with reversion.create_revision(atomic=True):
+ model.name = 'oncommit'
+ model.save()
+
+ transaction.on_commit(on_commit)
+
+ self.assertEqual(Revision.objects.all().count(), 2)
+
class CreateRevisionManageManuallyTest(TestModelMixin, TestBase):