Make Djblets Extension Template Loader Usable immediately after enabling an extension

Review Request #3907 — Created Feb. 23, 2013 and discarded — Latest diff uploaded

Information

Djblets

Reviewers

Note: This partially reverts Mike Conley's patch (Rev: 4fc4092) that was done couple years ago.

Immediately after enabling an extension (Before restart), the djblets extension template loader uses pkg_resources.ResourceLoader.resource_string, which for some reason throws a "NoneType is not callable" exception. Upon restart, everything is fine as Django will add it to the app_directories loader but it doesnt seem to load immediately. This patch reverts parts of mikeconley's patch (rev: 4fc4092) that uses the ResourceLoader to load the resource_string. Instead directly calling pkg_resources.resource_string seems to work just fine.

Tested this with Python 2.7 and a few extensions and was able to load the templates immediately after enabling them. With manager.resource_string, I was getting a "NoneType is not callable". 
Tested with couple of extensions that use Templates. Enabled the extension and Loading the templates works fine. Tested after restart as well.
    Loading...