Fixed a deprecation warning (#5058)

This commit is contained in:
Thierry Bastian 2017-09-27 10:51:45 +02:00 committed by Carlton Gibson
parent 296904099f
commit 760268ade2

View File

@ -1831,7 +1831,7 @@ class ModelField(Field):
def to_internal_value(self, data):
rel = get_remote_field(self.model_field, default=None)
if rel is not None:
return rel.to._meta.get_field(rel.field_name).to_python(data)
return rel.model._meta.get_field(rel.field_name).to_python(data)
return self.model_field.to_python(data)
def get_attribute(self, obj):