Used allow_migrate_model() shortcut in Field._check_backend_specific_checks().
@@ -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
