Skip to content

Commit 37e5244

Browse files
authored
Patches for Django warnings (#702)
* Remove deprecated providing_args argument RemovedInDjango40Warning: The providing_args argument is deprecated. As it is purely documentational, it has no replacement. If you rely on this argument as documentation, you can move the text to a code comment or docstring. * Try using django.urls.re_path() instead of django.conf.urls.url() but keep compatibility with older Django versions. RemovedInDjango40Warning: django.conf.urls.url() is deprecated in favor of django.urls.re_path(). * Add myself to AUTHORS.rst
1 parent 7b15389 commit 37e5244

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Authors
103103
- `vnagendra <https://github.com/vnagendra>`_
104104
- `yakimka <https://github.com/yakimka>`_
105105
- `Paulo Peres <https://github.com/PauloPeres>`_
106+
- `Alex Todorov <https://github.com/atodorov>`_
106107

107108
Background
108109
==========

simple_history/admin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
from django import http
55
from django.apps import apps as django_apps
66
from django.conf import settings
7-
from django.conf.urls import url
7+
8+
try:
9+
from django.urls import re_path as url
10+
except ImportError:
11+
from django.conf.urls import url
812
from django.contrib import admin
913
from django.contrib.admin import helpers
1014
from django.contrib.admin.utils import unquote

simple_history/signals.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
import django.dispatch
22

33

4-
pre_create_historical_record = django.dispatch.Signal(
5-
providing_args=[
6-
"instance",
7-
"history_instance",
8-
"history_date",
9-
"history_user",
10-
"history_change_reason",
11-
"using",
12-
]
13-
)
14-
post_create_historical_record = django.dispatch.Signal(
15-
providing_args=[
16-
"instance",
17-
"history_instance",
18-
"history_date",
19-
"history_user",
20-
"history_change_reason",
21-
"using",
22-
]
23-
)
4+
# Arguments: "instance", "history_instance", "history_date",
5+
# "history_user", "history_change_reason", "using"
6+
pre_create_historical_record = django.dispatch.Signal()
7+
8+
# Arguments: "instance", "history_instance", "history_date",
9+
# "history_user", "history_change_reason", "using"
10+
post_create_historical_record = django.dispatch.Signal()

simple_history/tests/urls.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from __future__ import unicode_literals
22

3-
from django.conf.urls import url
3+
try:
4+
from django.urls import re_path as url
5+
except ImportError:
6+
from django.conf.urls import url
47
from django.contrib import admin
58

69
from simple_history.tests.view import (

0 commit comments

Comments
 (0)