mirror of
https://github.com/django/django.git
synced 2024-11-29 22:56:46 +01:00
Refs #26144 -- Used proxy_for_model instead of mro inspection.
This commit is contained in:
parent
f91a04621e
commit
275314512d
@ -1,4 +1,3 @@
|
||||
import inspect
|
||||
import warnings
|
||||
from collections import OrderedDict
|
||||
|
||||
@ -142,7 +141,7 @@ class Command(BaseCommand):
|
||||
for model in models:
|
||||
if model in excluded_models:
|
||||
continue
|
||||
if model._meta.proxy and inspect.getmro(model)[1] not in models:
|
||||
if model._meta.proxy and model._meta.proxy_for_model not in models:
|
||||
warnings.warn(
|
||||
"%s is a proxy model and won't be serialized." % model._meta.label,
|
||||
category=ProxyModelWarning,
|
||||
|
Loading…
Reference in New Issue
Block a user