Fix a bug when using a ReferenceField(AbstractClass) #1920

This commit is contained in:
Bastien Gérard
2018-10-15 22:32:11 +02:00
parent 45c86be402
commit 59a06a242d
2 changed files with 40 additions and 17 deletions

View File

@@ -1176,15 +1176,6 @@ class ReferenceField(BaseField):
self.error('You can only reference documents once they have been '
'saved to the database')
if (
self.document_type._meta.get('abstract') and
not isinstance(value, self.document_type)
):
self.error(
'%s is not an instance of abstract reference type %s' % (
value, self.document_type._class_name)
)
def lookup_member(self, member_name):
return self.document_type._fields.get(member_name)