From 4df203a0908ac638f6c6da2b2e53096eb29506e8 Mon Sep 17 00:00:00 2001 From: Pamela McA'Nulty Date: Mon, 30 Jan 2017 23:30:33 -0500 Subject: [PATCH 1/2] Fix DJ check_debug issue with DJ1.10 --- README.rst | 8 ++++++++ django_coverage_plugin/plugin.py | 6 ++++++ setup.py | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 4657d36..6f459ac 100644 --- a/README.rst +++ b/README.rst @@ -61,6 +61,14 @@ plural text, so both are marked as used if the tag is used. Changes ~~~~~~~ +v1.4.2 --- 2017-01-30 +--------------------- + +Fixes `issue 36`_, and another instance of `issue 32`_, which are the result of an initialization order problem. + +.. _issue 32: https://github.com/nedbat/django_coverage_plugin/issues/32 +.. _issue 36: https://github.com/nedbat/django_coverage_plugin/issues/3r + v1.4.1 --- 2017-01-25 --------------------- diff --git a/django_coverage_plugin/plugin.py b/django_coverage_plugin/plugin.py index f91db03..a7e4ca2 100644 --- a/django_coverage_plugin/plugin.py +++ b/django_coverage_plugin/plugin.py @@ -54,6 +54,12 @@ def check_debug(): # into template engines, so we don't need to depend on settings values # directly and can look at the resulting configured objects + # I _think_ this check is all that's needed and the 3 "hasattr" checks + # below can be removed, but it's not clear how to verify that + from django.apps import apps + if not apps.ready: + return False + # django.template.backends.django gets loaded lazily, so return false # until they've been loaded if not hasattr(django.template, "backends"): diff --git a/setup.py b/setup.py index e0f53c3..fa41211 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup( name='django_coverage_plugin', - version='1.4.1', + version='1.4.2', description='Django template coverage.py plugin', author='Ned Batchelder', author_email='ned@nedbatchelder.com', From 949396362596489a52849821fc89c01bdfc258e5 Mon Sep 17 00:00:00 2001 From: Pamela McA'Nulty Date: Mon, 6 Feb 2017 20:41:23 -0500 Subject: [PATCH 2/2] Issue 36 is not fixed --- README.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 6f459ac..1e2acc5 100644 --- a/README.rst +++ b/README.rst @@ -64,10 +64,9 @@ Changes v1.4.2 --- 2017-01-30 --------------------- -Fixes `issue 36`_, and another instance of `issue 32`_, which are the result of an initialization order problem. +Fixes another instance of `issue 32`_, which was the result of an initialization order problem. .. _issue 32: https://github.com/nedbat/django_coverage_plugin/issues/32 -.. _issue 36: https://github.com/nedbat/django_coverage_plugin/issues/3r v1.4.1 --- 2017-01-25