mirror of
https://github.com/django/django.git
synced 2025-10-28 08:06:09 +00:00
[1.8.x] Fixed #24265 -- Preserved template backend loading exceptions.
If importing or initializing a template backend fails, attempting to
access this template backend again must raise the same exception.
Backport of 44ad6915 from master
This commit is contained in:
@@ -90,6 +90,10 @@ class EngineHandler(object):
|
||||
"Could not find config for '{}' "
|
||||
"in settings.TEMPLATES".format(alias))
|
||||
|
||||
# If importing or initializing the backend raises an exception,
|
||||
# self._engines[alias] isn't set and this code may get executed
|
||||
# again, so we must preserve the original params. See #24265.
|
||||
params = params.copy()
|
||||
backend = params.pop('BACKEND')
|
||||
engine_cls = import_string(backend)
|
||||
engine = engine_cls(params)
|
||||
|
||||
Reference in New Issue
Block a user