mirror of
https://github.com/django/django.git
synced 2025-06-16 00:49:12 +00:00
Removed default value for app_configs in system check functions.
The documentation[0] encourages users to write functions without a default for `app_configs`, and checks are always passed the argument. [0] https://docs.djangoproject.com/en/5.2/topics/checks/
This commit is contained in:
parent
1960ecd879
commit
75cd4fc8e3
@ -25,7 +25,7 @@ def _subclass_index(class_path, candidate_paths):
|
|||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
|
||||||
def check_user_model(app_configs=None, **kwargs):
|
def check_user_model(app_configs, **kwargs):
|
||||||
if app_configs is None:
|
if app_configs is None:
|
||||||
cls = apps.get_model(settings.AUTH_USER_MODEL)
|
cls = apps.get_model(settings.AUTH_USER_MODEL)
|
||||||
else:
|
else:
|
||||||
@ -121,7 +121,7 @@ def check_user_model(app_configs=None, **kwargs):
|
|||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
||||||
def check_models_permissions(app_configs=None, **kwargs):
|
def check_models_permissions(app_configs, **kwargs):
|
||||||
if app_configs is None:
|
if app_configs is None:
|
||||||
models = apps.get_models()
|
models = apps.get_models()
|
||||||
else:
|
else:
|
||||||
|
@ -4,7 +4,7 @@ from django.apps import apps
|
|||||||
from django.core.checks import Error
|
from django.core.checks import Error
|
||||||
|
|
||||||
|
|
||||||
def check_generic_foreign_keys(app_configs=None, **kwargs):
|
def check_generic_foreign_keys(app_configs, **kwargs):
|
||||||
from .fields import GenericForeignKey
|
from .fields import GenericForeignKey
|
||||||
|
|
||||||
if app_configs is None:
|
if app_configs is None:
|
||||||
@ -25,7 +25,7 @@ def check_generic_foreign_keys(app_configs=None, **kwargs):
|
|||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
||||||
def check_model_name_lengths(app_configs=None, **kwargs):
|
def check_model_name_lengths(app_configs, **kwargs):
|
||||||
if app_configs is None:
|
if app_configs is None:
|
||||||
models = apps.get_models()
|
models = apps.get_models()
|
||||||
else:
|
else:
|
||||||
|
@ -8,7 +8,7 @@ E005 = Error(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def check_finders(app_configs=None, **kwargs):
|
def check_finders(app_configs, **kwargs):
|
||||||
"""Check all registered staticfiles finders."""
|
"""Check all registered staticfiles finders."""
|
||||||
errors = []
|
errors = []
|
||||||
for finder in get_finders():
|
for finder in get_finders():
|
||||||
@ -21,7 +21,7 @@ def check_finders(app_configs=None, **kwargs):
|
|||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
||||||
def check_storages(app_configs=None, **kwargs):
|
def check_storages(app_configs, **kwargs):
|
||||||
"""Ensure staticfiles is defined in STORAGES setting."""
|
"""Ensure staticfiles is defined in STORAGES setting."""
|
||||||
errors = []
|
errors = []
|
||||||
if STATICFILES_STORAGE_ALIAS not in settings.STORAGES:
|
if STATICFILES_STORAGE_ALIAS not in settings.STORAGES:
|
||||||
|
@ -9,7 +9,7 @@ from django.core.checks import Error, Tags, Warning, register
|
|||||||
|
|
||||||
|
|
||||||
@register(Tags.models)
|
@register(Tags.models)
|
||||||
def check_all_models(app_configs=None, **kwargs):
|
def check_all_models(app_configs, **kwargs):
|
||||||
db_table_models = defaultdict(list)
|
db_table_models = defaultdict(list)
|
||||||
indexes = defaultdict(list)
|
indexes = defaultdict(list)
|
||||||
constraints = defaultdict(list)
|
constraints = defaultdict(list)
|
||||||
@ -223,5 +223,5 @@ def _check_lazy_references(apps, ignore=None):
|
|||||||
|
|
||||||
|
|
||||||
@register(Tags.models)
|
@register(Tags.models)
|
||||||
def check_lazy_references(app_configs=None, **kwargs):
|
def check_lazy_references(app_configs, **kwargs):
|
||||||
return _check_lazy_references(apps)
|
return _check_lazy_references(apps)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user