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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user