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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.