Ticket #23525: django_admindocs_filter-2.patch

File django_admindocs_filter-2.patch, 1.3 KB (added by Welborn Productions, 10 years ago)

Newer patch with suggested changes.

  • django/contrib/admindocs/views.py

    diff --git a/django/contrib/admindocs/views.py b/django/contrib/admindocs/views.py
    index f2b6535..67f7a48 100644
    a b def load_all_installed_template_libraries():  
    308308    for module_name in template.get_templatetags_modules():
    309309        mod = import_module(module_name)
    310310        try:
     311            modpath = os.path.dirname(upath(mod.__file__))
     312        except AttributeError:
     313            continue
     314        try:
    311315            libraries = [
    312316                os.path.splitext(p)[0]
    313                 for p in os.listdir(os.path.dirname(upath(mod.__file__)))
     317                for p in os.listdir(modpath)
    314318                if p.endswith('.py') and p[0].isalpha()
    315319            ]
    316320        except OSError:
    317             libraries = []
    318         for library_name in libraries:
    319             try:
    320                 template.get_library(library_name)
    321             except template.InvalidTemplateLibrary:
    322                 pass
     321            continue
     322        else:
     323            for library_name in libraries:
     324                try:
     325                    template.get_library(library_name)
     326                except template.InvalidTemplateLibrary:
     327                    pass
    323328
    324329
    325330def get_return_data_type(func_name):
Back to Top