models: do not try to import but check if cms is in INSTALLED_APPS

fix commit ae4e5cb8e
This commit is contained in:
Benjamin Dauvergne 2014-07-04 11:03:03 +02:00
parent a3d2ddbdb9
commit 742d41a929
1 changed files with 5 additions and 6 deletions

View File

@ -1,14 +1,13 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
try:
from cms.models import CMSPlugin
except ImportError:
CMSPlugin = None
from django.conf import settings
from . import utils
if CMSPlugin:
if 'cms' in settings.INSTALLED_APPS:
from cms.models import CMSPlugin
class PluginRenderer(CMSPlugin):
__renderer = None