diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-01-29 12:09:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-29 12:09:20 +0100 |
| commit | b7a3a6c9ef0a89625881b47594120bca55fa2e49 (patch) | |
| tree | 3032ff6b56dfdf1ffbce8214fd13669a7266d80e /django/contrib/admin/checks.py | |
| parent | a45c8d7ad04b73e33b6989c3ffa2b8c51ae3e83b (diff) | |
Used model's Options.label/label_lower where applicable.
Diffstat (limited to 'django/contrib/admin/checks.py')
| -rw-r--r-- | django/contrib/admin/checks.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/django/contrib/admin/checks.py b/django/contrib/admin/checks.py index ba754bd873..e088bc9142 100644 --- a/django/contrib/admin/checks.py +++ b/django/contrib/admin/checks.py @@ -607,8 +607,9 @@ class BaseModelAdminChecks: except FieldDoesNotExist: return [ checks.Error( - "The value of '%s' is not a callable, an attribute of '%s', or an attribute of '%s.%s'." % ( - label, obj.__class__.__name__, obj.model._meta.app_label, obj.model._meta.object_name + "The value of '%s' is not a callable, an attribute of " + "'%s', or an attribute of '%s'." % ( + label, obj.__class__.__name__, obj.model._meta.label, ), obj=obj.__class__, id='admin.E035', @@ -731,9 +732,9 @@ class ModelAdminChecks(BaseModelAdminChecks): checks.Error( "The value of '%s' refers to '%s', which is not a " "callable, an attribute of '%s', or an attribute or " - "method on '%s.%s'." % ( + "method on '%s'." % ( label, item, obj.__class__.__name__, - obj.model._meta.app_label, obj.model._meta.object_name, + obj.model._meta.label, ), obj=obj.__class__, id='admin.E108', @@ -1035,8 +1036,8 @@ class InlineModelAdminChecks(BaseModelAdminChecks): return [ checks.Error( "Cannot exclude the field '%s', because it is the foreign key " - "to the parent model '%s.%s'." % ( - fk.name, parent_model._meta.app_label, parent_model._meta.object_name + "to the parent model '%s'." % ( + fk.name, parent_model._meta.label, ), obj=obj.__class__, id='admin.E201', @@ -1113,9 +1114,8 @@ def must_inherit_from(parent, option, obj, id): def refer_to_missing_field(field, option, obj, id): return [ checks.Error( - "The value of '%s' refers to '%s', which is not an attribute of '%s.%s'." % ( - option, field, obj.model._meta.app_label, obj.model._meta.object_name - ), + "The value of '%s' refers to '%s', which is not an attribute of " + "'%s'." % (option, field, obj.model._meta.label), obj=obj.__class__, id=id, ), |
