diff options
| author | Joseph Kocherhans <joseph@jkocherhans.com> | 2010-02-23 14:59:30 +0000 |
|---|---|---|
| committer | Joseph Kocherhans <joseph@jkocherhans.com> | 2010-02-23 14:59:30 +0000 |
| commit | 8da76ffeaa47547edb24f99a55f8c9e1a8986b90 (patch) | |
| tree | 553e9e871c9829a1ef9710f58d7a748cb4bbb4c0 /django/forms | |
| parent | 7aeb37d610700fe25b07d5e76b943cc3d51ab1a5 (diff) | |
Fixed #12285. ModelForm raises a more informative error if it doesn't have a model class defined. Thanks, tobias.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12526 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 e292c1b9a7..430dd4d7cc 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -236,6 +236,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 = {} |
