Code quality

This commit is contained in:
Yohann D'ANELLO 2020-04-25 03:14:01 +02:00 committed by Valentin Samir
parent 4129687e41
commit 9cd44aa8aa
3 changed files with 12 additions and 2 deletions

View file

@ -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"

View file

@ -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

View file

@ -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: