From 0684b009634cb52b374d83e30866008c2330434c Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Wed, 27 Apr 2016 12:55:35 +0000 Subject: [PATCH] dj1.9: Fixed contenttype model import on resources --- orchestra/contrib/resources/backends.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/orchestra/contrib/resources/backends.py b/orchestra/contrib/resources/backends.py index e12e6135..68fe33bc 100644 --- a/orchestra/contrib/resources/backends.py +++ b/orchestra/contrib/resources/backends.py @@ -1,6 +1,5 @@ import datetime -from django.contrib.contenttypes.models import ContentType from django.utils import timezone from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ @@ -38,6 +37,7 @@ class ServiceMonitor(ServiceBackend): @cached_property def content_type(self): + from django.contrib.contenttypes.models import ContentType app_label, model = self.model.split('.') model = model.lower() return ContentType.objects.get_by_natural_key(app_label, model) @@ -68,6 +68,7 @@ class ServiceMonitor(ServiceBackend): def store(self, log): """ stores monitored values from stdout """ + from django.contrib.contenttypes.models import ContentType from .models import MonitorData name = self.get_name() app_label, model_name = self.model.split('.')