Skip to content

Commit f0cfdfa

Browse files
committed
Use better version checks, fix jazzband#78
1 parent 279fba2 commit f0cfdfa

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

dbtemplates/loader.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
from dbtemplates.utils.cache import (cache, get_cache_key,
88
set_and_return, get_cache_notfound_key)
99

10-
if django.get_version() >= '1.8':
11-
from django.template.loaders.base import Loader as tLoaderCls
10+
if django.VERSION[:2] >= (1, 8):
11+
from django.template.loaders.base import Loader as BaseLoader
1212
else:
13-
from django.template.loader import BaseLoader as tLoaderCls # noqa
13+
from django.template.loader import BaseLoader # noqa
1414

1515

16-
class Loader(tLoaderCls):
16+
class Loader(BaseLoader):
1717
"""
1818
A custom template loader to load templates from the database.
1919

dbtemplates/migrations/0001_initial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Migration(migrations.Migration):
1212
('sites', '0001_initial'),
1313
]
1414

15-
if django.get_version() >= '1.8':
15+
if django.VERSION[:2] >= (1, 8):
1616
operations = [
1717
migrations.CreateModel(
1818
name='Template',

dbtemplates/test_settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@
3737
'dbtemplates.loader.Loader',
3838
)
3939

40-
if django.get_version() <= '1.6':
40+
if django.VERSION[:2] <= (1, 6):
4141
TEST_RUNNER = 'discover_runner.DiscoverRunner'

0 commit comments

Comments
 (0)