From c2ad32ad85b9b6ded9cbeb3ca911527f041d229a Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sun, 6 Apr 2014 14:54:47 -0700 Subject: [PATCH] Don't check if db is managed when Django >1.6 --- django_statsd/patches/db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django_statsd/patches/db.py b/django_statsd/patches/db.py index 886cbf8..e5bea2b 100644 --- a/django_statsd/patches/db.py +++ b/django_statsd/patches/db.py @@ -1,3 +1,4 @@ +import django from django.db.backends import util from django_statsd.patches.utils import wrap @@ -13,7 +14,8 @@ def __getattr__(self, attr): If you are NOT in debug mode, this is the wrapper that's used. Sadly if it's in debug mode, we get a different wrapper. """ - if self.db.is_managed(): + if django.VERSION < (1, 6) and self.db.is_managed(): + # In Django 1.6 you can't put a connection in managed mode self.db.set_dirty() if attr in self.__dict__: return self.__dict__[attr]