Fix support for proxy models in formsets and admin inlines
(cherry picked from commit c2768f8101)
This commit is contained in:
1 parent
5c0b561ba2
commit
551e93c47c
3 files changed
+6
-7
No files matched your search
@@ -42,7 +42,7 @@ class GenericPolymorphicInlineModelAdmin(PolymorphicInlineModelAdmin, GenericInl
|
||||
Expose the ContentType that the child relates to.
|
||||
This can be used for the ``polymorphic_ctype`` field.
|
||||
"""
|
||||
return ContentType.objects.get_for_model(self.model)
|
||||
return ContentType.objects.get_for_model(self.model, for_concrete_model=False)
|
||||
|
||||
def get_formset_child(self, request, obj=None, **kwargs):
|
||||
# Similar to GenericInlineModelAdmin.get_formset(),
|
||||
|
||||
@@ -42,7 +42,7 @@ class PolymorphicInlineAdminFormSet(InlineAdminFormSet):
|
||||
"""
|
||||
for form, original in zip(self.formset.initial_forms, self.formset.get_queryset()):
|
||||
# Output the form
|
||||
model = original.get_real_concrete_instance_class()
|
||||
model = original.get_real_instance_class()
|
||||
child_inline = self.opts.get_child_inline_instance(model)
|
||||
view_on_site_url = self.opts.get_view_on_site_url(original)
|
||||
|
||||
|
||||
Reference in new issue
Block a user