Corrected return value of ForeignKey.db_check().

Field.db_check() should return None or a SQL string.
Returning [] happened to work because it’s falsey.
This commit is contained in:
Adam Johnson 2021-12-10 08:22:09 +00:00 committed by GitHub
parent 974e3b8750
commit 1be99e4e0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1035,7 +1035,7 @@ class ForeignKey(ForeignObject):
})
def db_check(self, connection):
return []
return None
def db_type(self, connection):
return self.target_field.rel_db_type(connection=connection)