Commits

mitar committed 9e0564d

Made django-filer support optional.

Comments (0)

Files changed (1)

cmsplugin_markup_tracwiki/tracwiki.py

 from cms import utils as cms_utils
 from cms.utils import moderator
 
-from filer.models import filemodels as filer_models
+if 'filer' in settings.INSTALLED_APPS:
+    from filer.models import filemodels as filer_models
+    USING_FILER = True
+else:
+    USING_FILER = False
 
 from cmsplugin_blog import models as blog_models
 
     
     def get_resource_realms(self):
         yield 'cms'
-        yield 'filer'
+        if USING_FILER:
+            yield 'filer'
         yield 'blog'
     
     def get_resource_url(self, res, href, **kwargs):
     
     def get_link_resolvers(self):
         yield ('cms', self._format_link)
-        yield ('filer', self._format_link)
+        if USING_FILER:
+            yield ('filer', self._format_link)
         yield ('blog', self._format_link)
 
 # TODO: Relative links [..] should traverse Django CMS hierarchy