Source

django-coverage / django_coverage / utils / coverage_report / html_report.py

Diff from to

File django_coverage/utils/coverage_report/html_report.py

     print >>fo, module_index.BOTTOM
     fo.close()
     
-    badge = open(os.path.join(
-        os.path.dirname(__file__), 
-        'badges', 
-        settings.COVERAGE_BADGE_TYPE, 
-        '%s.png' % int(overall_covered)
-    )).read()
-    open(os.path.join(outdir, 'coverage_status.png'), 'wb').write(badge)
+    if settings.COVERAGE_BADGE_TYPE:
+        badge = open(os.path.join(
+            os.path.dirname(__file__),
+            'badges',
+            settings.COVERAGE_BADGE_TYPE,
+            '%s.png' % int(overall_covered)
+        )).read()
+        open(os.path.join(outdir, 'coverage_status.png'), 'wb').write(badge)