From 9cd44aa8aac5e4143edd7e99dff143a8b9c3fc31 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 25 Apr 2020 03:14:01 +0200 Subject: [PATCH] Code quality --- .travis.yml | 2 ++ cas_server/models.py | 6 +++++- cas_server/views.py | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1499e34..7f0543b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,8 @@ matrix: env: TOX_ENV=py36-django21 - python: "3.7" env: TOX_ENV=py37-django22 + - python: "3.8" + env: TOX_ENV=py38-django22 - python: "3.8" env: TOX_ENV=py38-django30 - python: "3.8" diff --git a/cas_server/models.py b/cas_server/models.py index 607c048..b8950a6 100644 --- a/cas_server/models.py +++ b/cas_server/models.py @@ -20,7 +20,11 @@ try: from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ except ImportError: - def python_2_unicode_compatible(f): return f + def python_2_unicode_compatible(func): + """ + We use Django >= 3.0 with Python >= 3.4, we don't need Python 2 compatibility. + """ + return func from django.utils.translation import gettext_lazy as _ from django.core.mail import send_mail diff --git a/cas_server/views.py b/cas_server/views.py index f1616d4..a1f2873 100644 --- a/cas_server/views.py +++ b/cas_server/views.py @@ -24,7 +24,11 @@ try: from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext as _ except ImportError: - def python_2_unicode_compatible(f): return f + def python_2_unicode_compatible(func): + """ + We use Django >= 3.0 with Python >= 3.4, we don't need Python 2 compatibility. + """ + return func from django.utils.translation import gettext as _ from django.utils.safestring import mark_safe try: