Fix Djblets extension template loader, and fix templatetags caching problem

Review Request #1678 — Created June 22, 2010 and submitted

Information

Djblets
extensions

Reviewers

Originally, it looked like the extension template loader was working just fine.  I was wrong - for some reason, attempting to load an extension template from an extension that had *just* been enabled (and had been disabled at server boot) caused an exception (a "NoneType" was being called - eventually, I tracked this down to the get_provider function in pkg_resources... importing resource_string from pkg_resources didn't seem to do the job of initializing that function).  Importing the _manager directly seems to fix this.

I also realized there was a templatetag caching problem occurring.  I've solved this by clearing the templatetag cache upon extension enable/disable.
Manual.
mike_conley
chipx86
  1. 
      
  2. djblets/extensions/base.py (Diff revision 2)
     
     
     
     
    Invert the logic, like:
    
    if extension.info.app_name not in settings.INSTALLED_APPS:
        settings.INSTALLED_APPS.append(extension.info.app_name)
  3. djblets/extensions/base.py (Diff revision 2)
     
     
     
     
    Here too.
  4. djblets/extensions/loaders.py (Diff revision 2)
     
     
     
     
     
    This seems a little iffy to me.. If we can't import the manager, aren't we in trouble?
    
    At the least, the reason for this and the potential problems if we can't import this should be documented
  5. 
      
mike_conley
david
  1. Looks good.
  2. 
      
mike_conley
  1. Patch available here: http://github.com/mikeconley/djblets/commits/rr1678_fix_template_loader
  2. 
      
mike_conley
Review request changed
Change Summary:
Updated to merge nicely with latest extensions branch
chipx86
  1. Committed to extensions as 4fc4092
  2.