Ticket #4887: 4887_smart_str_comments.diff

File 4887_smart_str_comments.diff, 1012 bytes (added by Brian Rosner <brosner@…>, 8 years ago)
  • django/contrib/comments/templatetags/comments.py

     
    55from django.template import loader
    66from django.core.exceptions import ObjectDoesNotExist
    77from django.contrib.contenttypes.models import ContentType
     8from django.utils.encoding import smart_str
    89import re
    910
    1011register = template.Library()
     
    174175            if tokens[4] != 'with':
    175176                raise template.TemplateSyntaxError, "Fourth argument in %r tag must be 'with'" % tokens[0]
    176177            for option, args in zip(tokens[5::2], tokens[6::2]):
     178                option = smart_str(option)
    177179                if option in ('photos_optional', 'photos_required') and not self.free:
    178180                    # VALIDATION ##############################################
    179181                    option_list = args.split(',')
Back to Top