From cc7978aa0fff29ab79fa9a87312e196d8eeccaad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= <fpeters@entrouvert.com>
Date: Thu, 2 Apr 2020 21:10:49 +0200
Subject: [PATCH 3/4] trivial: import reverse from django.urls (#41286)

---
 tests/test_source_phone.py    | 2 +-
 welco/kb/models.py            | 2 +-
 welco/kb/views.py             | 2 +-
 welco/monkeypatch.py          | 2 +-
 welco/qualif/models.py        | 4 ++--
 welco/sources/mail/models.py  | 2 +-
 welco/sources/mail/views.py   | 2 +-
 welco/sources/phone/models.py | 2 +-
 welco/views.py                | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/test_source_phone.py b/tests/test_source_phone.py
index 2547674..954c797 100644
--- a/tests/test_source_phone.py
+++ b/tests/test_source_phone.py
@@ -19,7 +19,7 @@ import re
 
 import pytest
 
-from django.core.urlresolvers import reverse
+from django.urls import reverse
 from django.test import override_settings
 from django.utils import six
 from django.utils.encoding import force_text
diff --git a/welco/kb/models.py b/welco/kb/models.py
index 2be6588..e89c720 100644
--- a/welco/kb/models.py
+++ b/welco/kb/models.py
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from django.core.urlresolvers import reverse
+from django.urls import reverse
 from django.db import models
 from django.utils.translation import ugettext_lazy as _
 
diff --git a/welco/kb/views.py b/welco/kb/views.py
index 7054449..4c21b7c 100644
--- a/welco/kb/views.py
+++ b/welco/kb/views.py
@@ -20,7 +20,7 @@ from django import template
 from django.conf import settings
 from django.contrib.auth.decorators import login_required, user_passes_test
 from django.core.exceptions import PermissionDenied
-from django.core.urlresolvers import reverse_lazy
+from django.urls import reverse_lazy
 from django.db.models import Count
 from django.http import HttpResponse, HttpResponseRedirect
 from django.template import RequestContext
diff --git a/welco/monkeypatch.py b/welco/monkeypatch.py
index d3f8010..bf80fa0 100644
--- a/welco/monkeypatch.py
+++ b/welco/monkeypatch.py
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from django.core.urlresolvers import reverse
+from django.urls import reverse
 from django.forms.utils import flatatt
 from django.template.loader import render_to_string
 from django.utils.encoding import force_text
diff --git a/welco/qualif/models.py b/welco/qualif/models.py
index 8c563f1..8f092ad 100644
--- a/welco/qualif/models.py
+++ b/welco/qualif/models.py
@@ -16,7 +16,7 @@
 
 from django.contrib.contenttypes.models import ContentType
 from django.contrib.contenttypes.fields import GenericForeignKey
-from django.core.urlresolvers import reverse
+from django.urls import reverse
 from django.db import models
 from django.utils.translation import ugettext_lazy as _
 
@@ -24,7 +24,7 @@ from welco.utils import get_wcs_formdef_details, push_wcs_formdata, get_wcs_serv
 
 
 class Association(models.Model):
-    source_type = models.ForeignKey(ContentType)
+    source_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
     source_pk = models.PositiveIntegerField()
     source = GenericForeignKey('source_type', 'source_pk')
     comments = models.TextField(blank=True, verbose_name=_('Comments'))
diff --git a/welco/sources/mail/models.py b/welco/sources/mail/models.py
index d50d199..da62f9c 100644
--- a/welco/sources/mail/models.py
+++ b/welco/sources/mail/models.py
@@ -21,7 +21,7 @@ import subprocess
 from django.conf import settings
 from django.contrib.contenttypes.fields import GenericRelation
 from django.contrib.contenttypes.models import ContentType
-from django.core.urlresolvers import reverse
+from django.urls import reverse
 from django.db import models
 from django.db.models.signals import post_save
 from django.dispatch import receiver
diff --git a/welco/sources/mail/views.py b/welco/sources/mail/views.py
index 8a7b1fb..67e2e2a 100644
--- a/welco/sources/mail/views.py
+++ b/welco/sources/mail/views.py
@@ -21,7 +21,7 @@ from django import template
 from django.contrib.auth.decorators import login_required
 from django.contrib.contenttypes.models import ContentType
 from django.contrib import messages
-from django.core.urlresolvers import reverse
+from django.urls import reverse
 from django.template import RequestContext
 from django.http import HttpResponse, HttpResponseRedirect
 from django.utils.translation import ugettext_lazy as _
diff --git a/welco/sources/phone/models.py b/welco/sources/phone/models.py
index ec980b6..387bc20 100644
--- a/welco/sources/phone/models.py
+++ b/welco/sources/phone/models.py
@@ -18,7 +18,7 @@ import logging
 
 from django.conf import settings
 from django.contrib.contenttypes.fields import GenericRelation
-from django.core.urlresolvers import reverse
+from django.urls import reverse
 from django.db import models
 from django.utils.translation import ugettext_lazy as _
 from django.utils.timezone import now, timedelta
diff --git a/welco/views.py b/welco/views.py
index db06010..fd6ab38 100644
--- a/welco/views.py
+++ b/welco/views.py
@@ -22,7 +22,7 @@ from django.contrib.auth import views as auth_views
 from django.contrib.auth.decorators import login_required
 from django.contrib.contenttypes.models import ContentType
 from django.core.exceptions import PermissionDenied
-from django.core.urlresolvers import reverse
+from django.urls import reverse
 from django.http import HttpResponse, HttpResponseRedirect
 from django.shortcuts import resolve_url
 from django import template
-- 
2.26.0

