|
@@ -119,9 +119,10 @@ def check_models_permissions(app_configs=None, **kwargs):
|
|
|
)
|
|
|
errors.append(
|
|
|
checks.Error(
|
|
|
- "The verbose_name of model '%s.%s' must be at most %d characters "
|
|
|
- "for its builtin permission names to be at most %d characters." % (
|
|
|
- opts.app_label, opts.object_name, verbose_name_max_length, permission_name_max_length
|
|
|
+ "The verbose_name of model '%s' must be at most %d "
|
|
|
+ "characters for its builtin permission names to be at "
|
|
|
+ "most %d characters." % (
|
|
|
+ opts.label, verbose_name_max_length, permission_name_max_length
|
|
|
),
|
|
|
obj=model,
|
|
|
id='auth.E007',
|
|
@@ -138,11 +139,10 @@ def check_models_permissions(app_configs=None, **kwargs):
|
|
|
)
|
|
|
errors.append(
|
|
|
checks.Error(
|
|
|
- "The name of model '%s.%s' must be at most %d characters "
|
|
|
+ "The name of model '%s' must be at most %d characters "
|
|
|
"for its builtin permission codenames to be at most %d "
|
|
|
"characters." % (
|
|
|
- opts.app_label,
|
|
|
- opts.object_name,
|
|
|
+ opts.label,
|
|
|
model_name_max_length,
|
|
|
permission_codename_max_length,
|
|
|
),
|
|
@@ -156,8 +156,9 @@ def check_models_permissions(app_configs=None, **kwargs):
|
|
|
if len(name) > permission_name_max_length:
|
|
|
errors.append(
|
|
|
checks.Error(
|
|
|
- "The permission named '%s' of model '%s.%s' is longer than %d characters." % (
|
|
|
- name, opts.app_label, opts.object_name, permission_name_max_length
|
|
|
+ "The permission named '%s' of model '%s' is longer "
|
|
|
+ "than %d characters." % (
|
|
|
+ name, opts.label, permission_name_max_length,
|
|
|
),
|
|
|
obj=model,
|
|
|
id='auth.E008',
|
|
@@ -167,11 +168,10 @@ def check_models_permissions(app_configs=None, **kwargs):
|
|
|
if len(codename) > permission_codename_max_length:
|
|
|
errors.append(
|
|
|
checks.Error(
|
|
|
- "The permission codenamed '%s' of model '%s.%s' is "
|
|
|
+ "The permission codenamed '%s' of model '%s' is "
|
|
|
"longer than %d characters." % (
|
|
|
codename,
|
|
|
- opts.app_label,
|
|
|
- opts.object_name,
|
|
|
+ opts.label,
|
|
|
permission_codename_max_length,
|
|
|
),
|
|
|
obj=model,
|
|
@@ -183,9 +183,7 @@ def check_models_permissions(app_configs=None, **kwargs):
|
|
|
errors.append(
|
|
|
checks.Error(
|
|
|
"The permission codenamed '%s' clashes with a builtin permission "
|
|
|
- "for model '%s.%s'." % (
|
|
|
- codename, opts.app_label, opts.object_name
|
|
|
- ),
|
|
|
+ "for model '%s'." % (codename, opts.label),
|
|
|
obj=model,
|
|
|
id='auth.E005',
|
|
|
)
|
|
@@ -193,9 +191,8 @@ def check_models_permissions(app_configs=None, **kwargs):
|
|
|
elif codename in codenames:
|
|
|
errors.append(
|
|
|
checks.Error(
|
|
|
- "The permission codenamed '%s' is duplicated for model '%s.%s'." % (
|
|
|
- codename, opts.app_label, opts.object_name
|
|
|
- ),
|
|
|
+ "The permission codenamed '%s' is duplicated for "
|
|
|
+ "model '%s'." % (codename, opts.label),
|
|
|
obj=model,
|
|
|
id='auth.E006',
|
|
|
)
|