Commit 01ab84c6 authored by Tim Graham's avatar Tim Graham
Browse files

Fixed #23525 -- Fixed admindocs crash on apps installed as eggs.

Thanks welbornprod for report and initial patch.
parent cf2390be
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -315,6 +315,10 @@ def load_all_installed_template_libraries():
    # Load/register all template tag libraries from installed apps.
    for module_name in template.get_templatetags_modules():
        mod = import_module(module_name)
        if not hasattr(mod, '__file__'):
            # e.g. packages installed as eggs
            continue

        try:
            libraries = [
                os.path.splitext(p)[0]
@@ -322,7 +326,8 @@ def load_all_installed_template_libraries():
                if p.endswith('.py') and p[0].isalpha()
            ]
        except OSError:
            libraries = []
            continue
        else:
            for library_name in libraries:
                try:
                    template.get_library(library_name)
+2 −0
Original line number Diff line number Diff line
@@ -160,3 +160,5 @@ Bugfixes
  a crash when the index name requires it (:ticket:`#24015`).

* Added ``datetime.time`` support to migrations questioner (:ticket:`23998`).

* Fixed admindocs crash on apps installed as eggs (:ticket:`23525`).