X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/2d6ced7a340a86e610e9066e699ec1c05c6b2f3f..967eed676fc83d15b26149047f353ac61faa8217:/src/ajaxable/templatetags/ajaxable_tags.py diff --git a/src/ajaxable/templatetags/ajaxable_tags.py b/src/ajaxable/templatetags/ajaxable_tags.py index 55059e55b..d327e2eb6 100644 --- a/src/ajaxable/templatetags/ajaxable_tags.py +++ b/src/ajaxable/templatetags/ajaxable_tags.py @@ -3,7 +3,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import template -from django.utils.encoding import force_unicode +from django.utils.encoding import force_text from django.utils.safestring import mark_safe from ajaxable.utils import placeholdized @@ -23,7 +23,7 @@ def placeholdized_ul(form): @register.filter def pretty_field(field, template=None): if template is None: - template = ''' + template = u'''
  • %(errors)s @@ -32,14 +32,14 @@ def pretty_field(field, template=None): return mark_safe(template % { 'errors': field.errors, 'input': field, - 'label': force_unicode(field.label), - 'helptext': force_unicode(field.help_text), + 'label': ('*' if field.field.required else '') + force_text(field.label), + 'helptext': force_text(field.help_text), }) @register.filter def pretty_checkbox(field): - return pretty_field(field, template=''' + return pretty_field(field, template=u'''
  • %(errors)s