Fixed #4887 -- Fixed another place where template tag arguments are used
directly as function keyword args. Thanks, Brian Rosner. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5715 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
58096c4bcc
commit
29891add3d
1
AUTHORS
1
AUTHORS
|
@ -222,6 +222,7 @@ answer newbie questions, and generally made Django that much better:
|
||||||
rhettg@gmail.com
|
rhettg@gmail.com
|
||||||
Henrique Romano <onaiort@gmail.com>
|
Henrique Romano <onaiort@gmail.com>
|
||||||
Armin Ronacher
|
Armin Ronacher
|
||||||
|
Brian Rosner <brosner@gmail.com>
|
||||||
Oliver Rutherfurd <http://rutherfurd.net/>
|
Oliver Rutherfurd <http://rutherfurd.net/>
|
||||||
Ivan Sagalaev (Maniac) <http://www.softwaremaniacs.org/>
|
Ivan Sagalaev (Maniac) <http://www.softwaremaniacs.org/>
|
||||||
Vinay Sajip <vinay_sajip@yahoo.co.uk>
|
Vinay Sajip <vinay_sajip@yahoo.co.uk>
|
||||||
|
|
|
@ -5,6 +5,7 @@ from django import template
|
||||||
from django.template import loader
|
from django.template import loader
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
from django.utils.encoding import smart_str
|
||||||
import re
|
import re
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
@ -174,6 +175,7 @@ class DoCommentForm:
|
||||||
if tokens[4] != 'with':
|
if tokens[4] != 'with':
|
||||||
raise template.TemplateSyntaxError, "Fourth argument in %r tag must be 'with'" % tokens[0]
|
raise template.TemplateSyntaxError, "Fourth argument in %r tag must be 'with'" % tokens[0]
|
||||||
for option, args in zip(tokens[5::2], tokens[6::2]):
|
for option, args in zip(tokens[5::2], tokens[6::2]):
|
||||||
|
option = smart_str(option)
|
||||||
if option in ('photos_optional', 'photos_required') and not self.free:
|
if option in ('photos_optional', 'photos_required') and not self.free:
|
||||||
# VALIDATION ##############################################
|
# VALIDATION ##############################################
|
||||||
option_list = args.split(',')
|
option_list = args.split(',')
|
||||||
|
|
Loading…
Reference in New Issue