fix detecting whether childadmin has explicitly defined fields/fieldsets
parent
15426dc695
commit
180df8e98c
|
|
@ -63,8 +63,8 @@ class PolymorphicChildModelAdmin(admin.ModelAdmin):
|
||||||
kwargs.setdefault('form', self.base_form or self.form)
|
kwargs.setdefault('form', self.base_form or self.form)
|
||||||
|
|
||||||
# prevent infinite recursion when this is called from get_subclass_fields
|
# prevent infinite recursion when this is called from get_subclass_fields
|
||||||
if not hasattr(self, 'fieldsets') and not hasattr(self, 'fields'):
|
if not self.fieldsets and not self.fields:
|
||||||
kwargs.setdefault('fields', None)
|
kwargs.setdefault('fields', '__all__')
|
||||||
|
|
||||||
return super(PolymorphicChildModelAdmin, self).get_form(request, obj, **kwargs)
|
return super(PolymorphicChildModelAdmin, self).get_form(request, obj, **kwargs)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue