Permalink
Browse files

If display_name is None I don't need create a LoaderOrigin or LoaderO…

…riginLite
  • Loading branch information...
1 parent 823606a commit 59ed4ecea64df43b6ecabb4eb02ba08f57614798 @goinnn goinnn committed Jul 18, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 django/template/loader.py
View
@@ -85,10 +85,12 @@ def __init__(self, display_name, loader, name, dirs):
self.loader, self.loadname, self.dirs = loader, name, dirs
def make_origin(display_name, loader, name, dirs):
- if settings.TEMPLATE_DEBUG and display_name:
- return LoaderOrigin(display_name, loader, name, dirs)
- else:
- return LoaderOriginLite(display_name, loader, name, dirs)
+ if display_name:
+ if settings.TEMPLATE_DEBUG:
@yedpodtrzitko

yedpodtrzitko Jul 18, 2012

What is this if-else for, when it contains the same code?

@leotrubach

leotrubach Jul 18, 2012

Probably LoaderOriginLite should be in the second line

@goinnn

goinnn Jul 18, 2012

Contributor

This a intermediate step. Please, see the final diff:

https://github.com/django/django/pull/217/files#L2R81

+ return LoaderOrigin(display_name, loader, name, dirs)
+ else:
+ return LoaderOrigin(display_name, loader, name, dirs)
+ return None
def find_template_loader(loader):
if isinstance(loader, (tuple, list)):

0 comments on commit 59ed4ec

Please sign in to comment.