Commits

Steve Losh committed f3cd950

Fix the filter importing problem.

Comments (0)

Files changed (1)

blatter/__init__.py

     env = jinja2.Environment(loader=loader)
     for extra_filter in filter_configs_for(config):
         f = extra_filter['function']
-        f_module_path = '.'.join(f.split('.')[:-1])
+        f_module_path = '.'.join(f.split('.')[:-2])
+        f_module_name = f.split('.')[-2]
         f_filter_name = f.split('.')[-1]
-        mod = __import__(f_filter_name, fromlist=[f_module_path])
-        env.filters[extra_filter['name']] = getattr(mod, f.split('.')[-1])
+        
+        mod = __import__(f_module_name, fromlist=[f_module_path])
+        env.filters[extra_filter['name']] = getattr(mod, f_filter_name)
     return env
 
 def template_viewer_factory(config):