1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #14797 -- Corrected the handling of get_form_class() when a custom queryset has been defined, but a model hasn't. Thanks to Gabriel Grant for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-12-04 11:20:52 +00:00
parent 324658ef26
commit adfd7f8172
4 changed files with 10 additions and 5 deletions

View File

@@ -72,10 +72,7 @@ class ModelFormMixin(FormMixin, SingleObjectMixin):
if self.form_class:
return self.form_class
else:
if self.model is None:
model = self.queryset.model
else:
model = self.model
model = self.get_queryset().model
return model_forms.modelform_factory(model)
def get_form(self, form_class):