diff options
| author | Joseph Kocherhans <joseph@jkocherhans.com> | 2010-02-23 15:12:29 +0000 |
|---|---|---|
| committer | Joseph Kocherhans <joseph@jkocherhans.com> | 2010-02-23 15:12:29 +0000 |
| commit | d23f2249ea9ec4563ba18cf0c9de4d53d138113b (patch) | |
| tree | c677803bfca78d7f8503695ae94bcb28f4644129 /django/forms | |
| parent | c702e262ff7258773424b2842f49ae472d0c9f7b (diff) | |
[1.1.X] Fixed #12285. ModelForm raises a more informative error if it doesn't have a model class defined. Backport of [12526] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/models.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/forms/models.py b/django/forms/models.py index 4e8578e55e..1cbfba9602 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -214,6 +214,8 @@ class BaseModelForm(BaseForm): empty_permitted=False, instance=None): opts = self._meta if instance is None: + if opts.model is None: + raise ValueError('ModelForm has no model class specified.') # if we didn't get an instance, instantiate a new one self.instance = opts.model() object_data = {} |
