Skip to content

Commit 95ecb0d

Browse files
committed
chore: remove old Django version conditionals
1 parent ab8ca50 commit 95ecb0d

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

mezzanine/boot/__init__.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
"""
1111
from collections import defaultdict
1212

13-
from django import VERSION as DJANGO_VERSION
1413
from django.apps import apps
1514
from django.conf import settings
1615
from django.contrib import admin
1716
from django.core.exceptions import ImproperlyConfigured
18-
from django.db.models.signals import class_prepared
1917

2018
from mezzanine.boot.lazy_admin import LazyAdminSite
2119
from mezzanine.utils.importing import import_dotted_path
@@ -89,12 +87,8 @@ def add_extra_model_fields(sender, **kwargs):
8987
field.contribute_to_class(sender, field_name)
9088

9189

92-
if DJANGO_VERSION < (1, 9):
93-
if fields:
94-
class_prepared.connect(add_extra_model_fields, dispatch_uid="FQFEQ#rfq3r")
95-
else:
96-
for model_key in fields:
97-
apps.lazy_model_operation(add_extra_model_fields, model_key)
90+
for model_key in fields:
91+
apps.lazy_model_operation(add_extra_model_fields, model_key)
9892

9993

10094
# Override django.contrib.admin.site with LazyAdminSite. It must

mezzanine/core/apps.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from django import VERSION as DJANGO_VERSION
21
from django.apps import AppConfig
32

43

@@ -8,10 +7,3 @@ class CoreConfig(AppConfig):
87

98
def ready(self):
109
from . import checks # noqa
11-
12-
if DJANGO_VERSION < (1, 9):
13-
# add_to_builtins was removed in 1.9 and replaced with a
14-
# documented public API configured by the TEMPLATES setting.
15-
from django.template.base import add_to_builtins
16-
17-
add_to_builtins("mezzanine.template.loader_tags")

mezzanine/template/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import warnings
22
from functools import wraps
33

4-
from django import VERSION as DJANGO_VERSION
54
from django import template
65

76

@@ -20,7 +19,7 @@ def as_tag(self, tag_func):
2019
``var_name`` in the template.
2120
"""
2221
package = tag_func.__module__.split(".")[0]
23-
if DJANGO_VERSION >= (1, 9) and package != "mezzanine":
22+
if package != "mezzanine":
2423
warnings.warn(
2524
"The `as_tag` template tag builder is deprecated in favour of "
2625
"Django's built-in `simple_tag`, which supports variable "

0 commit comments

Comments
 (0)