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
|
import warnings
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
@ -142,7 +141,7 @@ class Command(BaseCommand):
|
||||||
for model in models:
|
for model in models:
|
||||||
if model in excluded_models:
|
if model in excluded_models:
|
||||||
continue
|
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(
|
warnings.warn(
|
||||||
"%s is a proxy model and won't be serialized." % model._meta.label,
|
"%s is a proxy model and won't be serialized." % model._meta.label,
|
||||||
category=ProxyModelWarning,
|
category=ProxyModelWarning,
|
||||||
|
|
Loading…
Reference in New Issue