Drop Django 2.2 support.

This commit is contained in:
Hasan Ramezani 2022-04-05 13:57:17 +02:00 committed by François Magimel
parent 8a5fa3f236
commit de0625b378
10 changed files with 15 additions and 19 deletions

View file

@ -3,6 +3,7 @@
#### Improvements
- feat: enable use of replica database (delegating the choice to `DATABASES_ROUTER`) ([#359](https://github.com/jazzband/django-auditlog/pull/359))
- Add `mask_fields` argument in `register` to mask sensitive information when logging ([#3710](https://github.com/jazzband/django-auditlog/pull/310))
- Django: Drop 2.2 support. `django_jsonfield_backport` is not required anymore ([#370](https://github.com/jazzband/django-auditlog/pull/370))
#### Important notes
- LogEntry no longer save to same database instance is using

View file

@ -1,5 +1,4 @@
from django.db import migrations
from django_jsonfield_backport.models import JSONField
from django.db import migrations, models
class Migration(migrations.Migration):
@ -12,6 +11,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name="logentry",
name="additional_data",
field=JSONField(null=True, blank=True),
field=models.JSONField(null=True, blank=True),
),
]

View file

@ -1,5 +1,4 @@
from django.db import migrations
from django_jsonfield_backport.models import JSONField
from django.db import migrations, models
class Migration(migrations.Migration):
@ -12,6 +11,8 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="logentry",
name="additional_data",
field=JSONField(null=True, verbose_name="additional data", blank=True),
field=models.JSONField(
null=True, verbose_name="additional data", blank=True
),
),
]

View file

@ -1,5 +1,4 @@
from django.db import migrations
from django_jsonfield_backport.models import JSONField
from django.db import migrations, models
class Migration(migrations.Migration):
@ -12,6 +11,8 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="logentry",
name="additional_data",
field=JSONField(blank=True, null=True, verbose_name="additional data"),
field=models.JSONField(
blank=True, null=True, verbose_name="additional data"
),
),
]

View file

@ -12,7 +12,6 @@ from django.db.models import Field, Q, QuerySet
from django.utils import formats, timezone
from django.utils.encoding import smart_str
from django.utils.translation import gettext_lazy as _
from django_jsonfield_backport.models import JSONField
class LogEntryManager(models.Manager):
@ -222,7 +221,7 @@ class LogEntry(models.Model):
blank=True, null=True, verbose_name=_("remote address")
)
timestamp = models.DateTimeField(auto_now_add=True, verbose_name=_("timestamp"))
additional_data = JSONField(
additional_data = models.JSONField(
blank=True, null=True, verbose_name=_("additional data")
)

View file

@ -14,7 +14,6 @@ INSTALLED_APPS = [
"django.contrib.sessions",
"django.contrib.admin",
"django.contrib.staticfiles",
"django_jsonfield_backport",
"auditlog",
"auditlog_tests",
]

View file

@ -3,4 +3,3 @@ django>=3.2,<3.3
sphinx
sphinx_rtd_theme
psycopg2-binary
django-jsonfield-backport>=1.0.0

View file

@ -12,9 +12,9 @@ The repository can be found at https://github.com/jazzband/django-auditlog/.
**Requirements**
- Python 3.7 or higher
- Django 2.2 or higher
- Django 3.2 or higher
Auditlog is currently tested with Python 3.7+ and Django 2.2, 3.2 and 4.0. The latest test report can be found
Auditlog is currently tested with Python 3.7+ and Django 3.2 and 4.0. The latest test report can be found
at https://github.com/jazzband/django-auditlog/actions.
Adding Auditlog to your Django application

View file

@ -27,7 +27,7 @@ setup(
description="Audit log app for Django",
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=["django-jsonfield-backport>=1.0.0", "python-dateutil>=2.6.0"],
install_requires=["python-dateutil>=2.6.0"],
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 3",
@ -36,7 +36,6 @@ setup(
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Framework :: Django",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"License :: OSI Approved :: MIT License",

View file

@ -1,6 +1,5 @@
[tox]
envlist =
{py37,py38,py39}-django22
{py37,py38,py39,py10}-django32
{py38,py39,py10}-django{40,main}
py38-docs
@ -11,7 +10,6 @@ commands =
coverage run --source auditlog runtests.py
coverage xml
deps =
django22: Django>=2.2,<2.3
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
djangomain: https://github.com/django/django/archive/main.tar.gz