Corrects the ImportError handling for the override mechanism.
Fixes bug 973836. Change-Id: Ide849ca230d1e07c7242268d32f06600e09c6746
This commit is contained in:
parent
bf9abd5811
commit
a4679bc7b5
@ -743,12 +743,13 @@ class Site(Registry, HorizonComponent):
|
|||||||
bits = customization_module.split('.')
|
bits = customization_module.split('.')
|
||||||
mod_name = bits.pop()
|
mod_name = bits.pop()
|
||||||
package = '.'.join(bits)
|
package = '.'.join(bits)
|
||||||
|
mod = import_module(package)
|
||||||
try:
|
try:
|
||||||
before_import_registry = copy.copy(self._registry)
|
before_import_registry = copy.copy(self._registry)
|
||||||
import_module('%s.%s' % (package, mod_name))
|
import_module('%s.%s' % (package, mod_name))
|
||||||
except:
|
except:
|
||||||
self._registry = before_import_registry
|
self._registry = before_import_registry
|
||||||
if module_has_submodule(package, mod_name):
|
if module_has_submodule(mod, mod_name):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# Compile the dynamic urlconf.
|
# Compile the dynamic urlconf.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user