0
0
mirror of https://github.com/django/django.git synced 2024-12-01 15:42:04 +01:00

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

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)