Ticket #19557: django-widget-has_changed.patch

File django-widget-has_changed.patch, 958 bytes (added by jrief, 2 years ago)

patch

  • forms/forms.py

    diff -ru django/forms/forms.py django.fix/forms/forms.py
    old new  
    1414from django.utils.html import conditional_escape
    1515from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode
    1616from django.utils.safestring import mark_safe
     17from django.utils.formats import localize
    1718
    1819
    1920__all__ = ('BaseForm', 'Form')
     
    341342                    hidden_widget = field.hidden_widget()
    342343                    initial_value = hidden_widget.value_from_datadict(
    343344                        self.data, self.files, initial_prefixed_name)
     345                if field.widget.is_localized:
     346                    initial_value = localize(initial_value)
    344347                if field.widget._has_changed(initial_value, data_value):
    345348                    self._changed_data.append(name)
    346349        return self._changed_data
Back to Top