diff options
Diffstat (limited to 'django/forms/fields.py')
| -rw-r--r-- | django/forms/fields.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index 33ed2882a3..f2b5b77185 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -604,6 +604,8 @@ class FileField(Field): return data def has_changed(self, initial, data): + if self.disabled: + return False if data is None: return False return True @@ -724,6 +726,8 @@ class BooleanField(Field): raise ValidationError(self.error_messages['required'], code='required') def has_changed(self, initial, data): + if self.disabled: + return False # Sometimes data or initial may be a string equivalent of a boolean # so we should run it through to_python first to get a boolean value return self.to_python(initial) != self.to_python(data) @@ -891,6 +895,8 @@ class MultipleChoiceField(ChoiceField): ) def has_changed(self, initial, data): + if self.disabled: + return False if initial is None: initial = [] if data is None: @@ -1069,6 +1075,8 @@ class MultiValueField(Field): raise NotImplementedError('Subclasses must implement this method.') def has_changed(self, initial, data): + if self.disabled: + return False if initial is None: initial = ['' for x in range(0, len(data))] else: |
