Used allow_migrate_model() shortcut in Field._check_backend_specific_checks().

This commit is contained in:
Mariusz Felisiak 2022-12-24 21:16:22 +01:00 committed by GitHub
parent e07e83589b
commit 48b6108e50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -411,12 +411,9 @@ class Field(RegisterLookupMixin):
def _check_backend_specific_checks(self, databases=None, **kwargs):
if databases is None:
return []
app_label = self.model._meta.app_label
errors = []
for alias in databases:
if router.allow_migrate(
alias, app_label, model_name=self.model._meta.model_name
):
if router.allow_migrate_model(alias, self.model):
errors.extend(connections[alias].validation.check_field(self, **kwargs))
return errors