diff --git a/Pipfile b/Pipfile index c789dac..7b3677b 100644 --- a/Pipfile +++ b/Pipfile @@ -6,7 +6,7 @@ name = "pypi" [packages] dnspython = "*" netaddr = "*" -django = "~=2.2.0" +django = "~=3.0.0" django-bootstrap-form = "*" django-referrer-policy = "*" django-registration-redux = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 1c7e9f8..043db55 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "984dd184466999fd5afc4cfff15571e230e37769e0a7f5f1183a6a6fc404bb54" + "sha256": "e69d1b89b750a32ddcc3b79ad32e823e55cd3e5d25e7ad1bce4c520803db6ac2" }, "pipfile-spec": 6, "requires": { @@ -16,6 +16,14 @@ ] }, "default": { + "asgiref": { + "hashes": [ + "sha256:71e68008da809b957b7ee4b43dbccff33d1b23519fb8344e33f049897077afac", + "sha256:9567dfe7bd8d3c8c892227827c41cce860b368104c3431da67a0c5a65a949506" + ], + "markers": "python_version >= '3.7'", + "version": "==3.6.0" + }, "certifi": { "hashes": [ "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3", @@ -225,11 +233,11 @@ }, "django": { "hashes": [ - "sha256:0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413", - "sha256:365429d07c1336eb42ba15aa79f45e1c13a0b04d5c21569e7d596696418a6a45" + "sha256:9bc7aa619ed878fedba62ce139abe663a147dccfd20e907725ec11e02a1ca225", + "sha256:d58d8394036db75a81896037d757357e79406e8f68816c3e8a28721c1d9d4c11" ], "index": "pypi", - "version": "==2.2.28" + "version": "==3.0.14" }, "django-bootstrap-form": { "hashes": [ @@ -420,6 +428,14 @@ "markers": "python_version >= '3.6'", "version": "==0.7.13" }, + "asgiref": { + "hashes": [ + "sha256:71e68008da809b957b7ee4b43dbccff33d1b23519fb8344e33f049897077afac", + "sha256:9567dfe7bd8d3c8c892227827c41cce860b368104c3431da67a0c5a65a949506" + ], + "markers": "python_version >= '3.7'", + "version": "==3.6.0" + }, "astroid": { "hashes": [ "sha256:3bc7834720e1a24ca797fd785d77efb14f7a28ee8e635ef040b6e2d80ccb3303", @@ -555,11 +571,11 @@ }, "django": { "hashes": [ - "sha256:0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413", - "sha256:365429d07c1336eb42ba15aa79f45e1c13a0b04d5c21569e7d596696418a6a45" + "sha256:9bc7aa619ed878fedba62ce139abe663a147dccfd20e907725ec11e02a1ca225", + "sha256:d58d8394036db75a81896037d757357e79406e8f68816c3e8a28721c1d9d4c11" ], "index": "pypi", - "version": "==2.2.28" + "version": "==3.0.14" }, "django-debug-toolbar": { "hashes": [ diff --git a/requirements.d/all.txt b/requirements.d/all.txt index 65eb78f..6868737 100644 --- a/requirements.d/all.txt +++ b/requirements.d/all.txt @@ -1,7 +1,7 @@ # packages always needed dnspython netaddr -django~=2.2.0 +django~=3.0.0 django-bootstrap-form django-referrer-policy django-registration-redux diff --git a/setup.py b/setup.py index 2ef985e..e97a4a4 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ setup( install_requires=[ 'dnspython', 'netaddr', - 'django>=2.2.0', + 'django>=3.0.0', 'django-bootstrap-form', 'django-referrer-policy', 'django-registration-redux', diff --git a/src/nsupdate/accounts/models.py b/src/nsupdate/accounts/models.py index 50e35c6..4c29a36 100644 --- a/src/nsupdate/accounts/models.py +++ b/src/nsupdate/accounts/models.py @@ -9,11 +9,8 @@ from django.dispatch import receiver from django.contrib.auth.signals import user_logged_in from django.utils.translation import ugettext_lazy as _ from django.utils.translation import LANGUAGE_SESSION_KEY -from django.utils.encoding import python_2_unicode_compatible -from django.utils.six import text_type -@python_2_unicode_compatible class UserProfile(models.Model): """ stuff we need additionally to what Django stores in User model @@ -25,7 +22,7 @@ class UserProfile(models.Model): verbose_name=_('language')) def __str__(self): - return u"profile for %s" % text_type(self.user) + return u"profile for %s" % str(self.user) class Meta: verbose_name = _('user profile') diff --git a/src/nsupdate/main/models.py b/src/nsupdate/main/models.py index 9a4485d..4092981 100644 --- a/src/nsupdate/main/models.py +++ b/src/nsupdate/main/models.py @@ -18,8 +18,6 @@ from django.db.models.signals import pre_delete, post_save from django.contrib.auth.hashers import make_password from django.utils.timezone import now from django.utils.translation import ugettext_lazy as _ -from django.utils.encoding import python_2_unicode_compatible -from django.utils.six import text_type from . import dnstools @@ -34,7 +32,6 @@ def result_fmt(msg): return msg[:RESULT_MSG_LEN] -@python_2_unicode_compatible class BlacklistedHost(models.Model): name_re = models.CharField( _('name RegEx'), @@ -81,7 +78,6 @@ UPDATE_ALGORITHMS = { UPDATE_ALGORITHM_CHOICES = [(k, k) for k in UPDATE_ALGORITHMS] -@python_2_unicode_compatible class Domain(models.Model): name = models.CharField( _("name"), @@ -154,7 +150,6 @@ class Domain(models.Model): ordering = ('name',) -@python_2_unicode_compatible class Host(models.Model): name = models.CharField( _("name"), @@ -373,7 +368,6 @@ def post_save_host(sender, **kwargs): post_save.connect(post_save_host, sender=Host) -@python_2_unicode_compatible class RelatedHost(models.Model): # host addr = network_of_main_host + interface_id name = models.CharField( @@ -414,7 +408,7 @@ class RelatedHost(models.Model): verbose_name=_("main host")) def __str__(self): - return u"%s.%s" % (self.name, text_type(self.main_host)) + return u"%s.%s" % (self.name, str(self.main_host)) class Meta(object): unique_together = (('name', 'main_host'),) @@ -447,7 +441,6 @@ class RelatedHost(models.Model): pre_delete.connect(pre_delete_host, sender=RelatedHost) -@python_2_unicode_compatible class ServiceUpdater(models.Model): name = models.CharField( _("name"), @@ -491,7 +484,6 @@ class ServiceUpdater(models.Model): verbose_name_plural = _('service updaters') -@python_2_unicode_compatible class ServiceUpdaterHostConfig(models.Model): service = models.ForeignKey(ServiceUpdater, on_delete=models.CASCADE, verbose_name=_("service")) diff --git a/src/nsupdate/urls.py b/src/nsupdate/urls.py index e0526ee..6a7b2e0 100644 --- a/src/nsupdate/urls.py +++ b/src/nsupdate/urls.py @@ -5,7 +5,7 @@ top-level url dispatching from django.conf import settings from django.conf.urls import include, url from django.contrib import admin -from django.contrib.auth import views as auth_views +from django.contrib.auth import login from django.conf.urls.static import static from django.http import HttpResponse from django.views.generic import RedirectView @@ -20,7 +20,7 @@ def remember_me_login(request, *args, **kw): if request.method == 'POST': if request.POST.get('remember_me'): request.session.set_expiry(settings.SESSION_COOKIE_AGE) - return auth_views.login(request, *args, **kw) + return login(request, *args, **kw) urlpatterns = [