From 419ed444360cd9b843253f3901a96d41b003251e Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 16 Apr 2009 14:26:08 +0000 Subject: Fixed #10363 -- Modified ModelForm handling to ensure that excluded fields can't be saved onto the model. Thanks to jgoldberg for the report, an Alex Gaynor for the fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10575 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/forms/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'django/forms') diff --git a/django/forms/models.py b/django/forms/models.py index 010d3bf61c..de5f1abb45 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -334,7 +334,8 @@ class BaseModelForm(BaseForm): fail_message = 'created' else: fail_message = 'changed' - return save_instance(self, self.instance, self._meta.fields, fail_message, commit) + return save_instance(self, self.instance, self._meta.fields, + fail_message, commit, exclude=self._meta.exclude) save.alters_data = True -- cgit v1.3