mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Refs #13167 -- Corrected a regression in the way non-existent variables are handled by {% if %} tags. Thanks to ohmi2 for pointing out the regression in 1.2, and Karen for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12954 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -243,7 +243,12 @@ class IfNode(Node): | ||||
|             yield node | ||||
|  | ||||
|     def render(self, context): | ||||
|         if self.var.eval(context): | ||||
|         try: | ||||
|             var = self.var.eval(context) | ||||
|         except VariableDoesNotExist: | ||||
|             var = None | ||||
|  | ||||
|         if var: | ||||
|             return self.nodelist_true.render(context) | ||||
|         else: | ||||
|             return self.nodelist_false.render(context) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user