diff --git a/.travis.yml b/.travis.yml index e938af6..4a4b5a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,18 +15,18 @@ env: matrix: include: - - python: "2.7" - dist: trusty - env: DJANGO=1.11 COVERAGE="coverage run -m" TEST_K="not ddns_client" TEST_OPTS="--pep8" - python: "3.5" - dist: trusty - env: DJANGO=1.11 + dist: xenial + env: DJANGO=2.2 - python: "3.6" - dist: trusty - env: DJANGO=1.11 + dist: xenial + env: DJANGO=2.2 - python: "3.7" dist: xenial env: DJANGO=2.2 + - python: "3.8" + dist: xenial + env: DJANGO=2.2 COVERAGE="coverage run -m" TEST_K="not ddns_client" TEST_OPTS="--pep8" install: - ./scripts/travis/install.sh diff --git a/LICENSE b/LICENSE index 5eb03cd..0f343b8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ This project is licensed under the the 3-clause BSD license (also known as "Revised BSD License", "New BSD License", or "Modified BSD License"): -Copyright (c) 2013-2018, The nsupdate.info Development Team (see AUTHORS file) +Copyright (c) 2013-2020, The nsupdate.info Development Team (see AUTHORS file) All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/docs/admin.rst b/docs/admin.rst index 0f9945b..e33965f 100644 --- a/docs/admin.rst +++ b/docs/admin.rst @@ -227,6 +227,11 @@ To make nsupdate.info (Django) use PostgreSQL, put this into YOUR settings:: Now proceed with manage migrate as shown above. +Disable User Registration +------------------------- +If you want to disable user registration, put this into YOUR settings:: + + REGISTRATION_OPEN = False Customization of the Web UI =========================== diff --git a/logo/github_social_preview.png b/logo/github_social_preview.png new file mode 100644 index 0000000..b2ebd2c Binary files /dev/null and b/logo/github_social_preview.png differ diff --git a/requirements.d/all.txt b/requirements.d/all.txt index 86afe67..65eb78f 100644 --- a/requirements.d/all.txt +++ b/requirements.d/all.txt @@ -1,7 +1,7 @@ # packages always needed dnspython netaddr -django~=1.11.0 +django~=2.2.0 django-bootstrap-form django-referrer-policy django-registration-redux diff --git a/setup.py b/setup.py index 9171705..2ef985e 100644 --- a/setup.py +++ b/setup.py @@ -29,9 +29,9 @@ setup( platforms='any', setup_requires=['setuptools_scm'], install_requires=[ - 'dnspython<1.17.0', # 1.16 is last with py27 support + 'dnspython', 'netaddr', - 'django>=1.11.0', + 'django>=2.2.0', 'django-bootstrap-form', 'django-referrer-policy', 'django-registration-redux', @@ -47,12 +47,11 @@ setup( 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Internet :: Name Service (DNS)', ], ) diff --git a/src/nsupdate/main/admin.py b/src/nsupdate/main/admin.py index 1997c1f..1316dd9 100644 --- a/src/nsupdate/main/admin.py +++ b/src/nsupdate/main/admin.py @@ -3,6 +3,8 @@ register our models for Django's admin """ from django.contrib import admin +from django.urls import reverse +from django.utils.safestring import mark_safe from .models import Host, RelatedHost, Domain, BlacklistedHost, ServiceUpdater, ServiceUpdaterHostConfig @@ -16,10 +18,19 @@ class DomainAdmin(admin.ModelAdmin): @admin.register(Host) class HostAdmin(admin.ModelAdmin): - list_display = ("name", "domain", "created_by", "client_faults", "api_auth_faults", "abuse", "abuse_blocked") + list_display = ("name", "domain", "created_by_link", "client_faults", "api_auth_faults", "abuse", "abuse_blocked") list_filter = ("created", "abuse", "abuse_blocked", "domain") + read_only_fields = ('created_by_link',) + search_fields = ("name", "created_by__username", "created_by__email") + def created_by_link(self, obj): + return mark_safe('{}'.format( + reverse("admin:auth_user_change", args=(obj.created_by.pk,)), + obj.created_by.username + )) + created_by_link.short_description = 'created by' + @admin.register(RelatedHost) class RelatedHostAdmin(admin.ModelAdmin): diff --git a/src/nsupdate/settings/base.py b/src/nsupdate/settings/base.py index f5a4d28..76063e8 100644 --- a/src/nsupdate/settings/base.py +++ b/src/nsupdate/settings/base.py @@ -149,7 +149,7 @@ TEMPLATES = [ # 'django.template.context_processors.media', # 'django.template.context_processors.static', # 'django.template.context_processors.tz', - # 'django.contrib.messages.context_processors.messages', + 'django.contrib.messages.context_processors.messages', 'social_django.context_processors.backends', 'social_django.context_processors.login_redirect', diff --git a/src/nsupdate/templates/base.html b/src/nsupdate/templates/base.html index 07ba28e..c48b4cd 100644 --- a/src/nsupdate/templates/base.html +++ b/src/nsupdate/templates/base.html @@ -9,8 +9,8 @@