X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/111104c8e3e9487965eac9e916200a12d43bf2be..8952b9530d943655e552ea660c47e850123c5105:/src/ajaxable/templatetags/ajaxable_tags.py diff --git a/src/ajaxable/templatetags/ajaxable_tags.py b/src/ajaxable/templatetags/ajaxable_tags.py index 72b9baad4..2d980f278 100644 --- a/src/ajaxable/templatetags/ajaxable_tags.py +++ b/src/ajaxable/templatetags/ajaxable_tags.py @@ -1,11 +1,12 @@ -# -*- 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_text from django.utils.safestring import mark_safe - from ajaxable.utils import placeholdized + + register = template.Library() @@ -31,8 +32,8 @@ def pretty_field(field, template=None): return mark_safe(template % { 'errors': field.errors, 'input': field, - 'label': field.label, - 'helptext': field.help_text, + 'label': ('*' if field.field.required else '') + force_text(field.label), + 'helptext': force_text(field.help_text), })