mirror of
https://github.com/django/django.git
synced 2025-06-02 10:09:12 +00:00
[1.7.x] Fixed #23525 -- Fixed admindocs crash on apps installed as eggs.
Thanks welbornprod for report and initial patch. Backport of 01ab84c61330ffa5ac87c637249611c5e5343e57 from master
This commit is contained in:
parent
4c92ecd705
commit
ac098867c0
@ -309,6 +309,10 @@ def load_all_installed_template_libraries():
|
|||||||
# Load/register all template tag libraries from installed apps.
|
# Load/register all template tag libraries from installed apps.
|
||||||
for module_name in template.get_templatetags_modules():
|
for module_name in template.get_templatetags_modules():
|
||||||
mod = import_module(module_name)
|
mod = import_module(module_name)
|
||||||
|
if not hasattr(mod, '__file__'):
|
||||||
|
# e.g. packages installed as eggs
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
libraries = [
|
libraries = [
|
||||||
os.path.splitext(p)[0]
|
os.path.splitext(p)[0]
|
||||||
@ -316,12 +320,13 @@ def load_all_installed_template_libraries():
|
|||||||
if p.endswith('.py') and p[0].isalpha()
|
if p.endswith('.py') and p[0].isalpha()
|
||||||
]
|
]
|
||||||
except OSError:
|
except OSError:
|
||||||
libraries = []
|
continue
|
||||||
for library_name in libraries:
|
else:
|
||||||
try:
|
for library_name in libraries:
|
||||||
template.get_library(library_name)
|
try:
|
||||||
except template.InvalidTemplateLibrary:
|
template.get_library(library_name)
|
||||||
pass
|
except template.InvalidTemplateLibrary:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def get_return_data_type(func_name):
|
def get_return_data_type(func_name):
|
||||||
|
@ -160,3 +160,5 @@ Bugfixes
|
|||||||
a crash when the index name requires it (:ticket:`#24015`).
|
a crash when the index name requires it (:ticket:`#24015`).
|
||||||
|
|
||||||
* Added ``datetime.time`` support to migrations questioner (:ticket:`23998`).
|
* Added ``datetime.time`` support to migrations questioner (:ticket:`23998`).
|
||||||
|
|
||||||
|
* Fixed admindocs crash on apps installed as eggs (:ticket:`23525`).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user