diff --git a/django/contrib/contenttypes/generic.py b/django/contrib/contenttypes/generic.py
index 0d542a4..4f15d41 100644
a
|
b
|
class GenericInlineModelAdmin(InlineModelAdmin):
|
387 | 387 | fields = flatten_fieldsets(self.declared_fieldsets) |
388 | 388 | else: |
389 | 389 | fields = None |
| 390 | if self.exclude is None: |
| 391 | exclude = [] |
| 392 | else: |
| 393 | exclude = list(self.exclude) |
| 394 | exclude.extend(self.get_readonly_fields(request, obj)) |
| 395 | exclude = exclude or None |
| 396 | |
390 | 397 | defaults = { |
391 | 398 | "ct_field": self.ct_field, |
392 | 399 | "fk_field": self.ct_fk_field, |
… |
… |
class GenericInlineModelAdmin(InlineModelAdmin):
|
398 | 405 | "can_order": False, |
399 | 406 | "fields": fields, |
400 | 407 | "max_num": self.max_num, |
401 | | "exclude": self.exclude |
| 408 | "exclude": exclude |
402 | 409 | } |
403 | 410 | return generic_inlineformset_factory(self.model, **defaults) |
404 | 411 | |