X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6ff3fa3548cb227f9c26bd5e7552f1769c9ce277..116ce833f4ff761db288866564e430f7d2bae86d:/src/ajaxable/templatetags/ajaxable_tags.py diff --git a/src/ajaxable/templatetags/ajaxable_tags.py b/src/ajaxable/templatetags/ajaxable_tags.py index 9af58e935..940648143 100644 --- a/src/ajaxable/templatetags/ajaxable_tags.py +++ b/src/ajaxable/templatetags/ajaxable_tags.py @@ -1,9 +1,8 @@ -# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # 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 @@ -32,14 +31,14 @@ def pretty_field(field, template=None): return mark_safe(template % { 'errors': field.errors, 'input': field, - 'label': ('*' if field.field.required else '') + 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=u''' + return pretty_field(field, template='''
  • %(errors)s