1
0
mirror of https://github.com/django/django.git synced 2025-06-13 15:39:13 +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:
Adam Johnson 2025-06-11 16:46:28 +01:00 committed by GitHub
parent 1960ecd879
commit 75cd4fc8e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View File

@ -25,7 +25,7 @@ def _subclass_index(class_path, candidate_paths):
return -1
def check_user_model(app_configs=None, **kwargs):
def check_user_model(app_configs, **kwargs):
if app_configs is None:
cls = apps.get_model(settings.AUTH_USER_MODEL)
else:
@ -121,7 +121,7 @@ def check_user_model(app_configs=None, **kwargs):
return errors
def check_models_permissions(app_configs=None, **kwargs):
def check_models_permissions(app_configs, **kwargs):
if app_configs is None:
models = apps.get_models()
else:

View File

@ -4,7 +4,7 @@ from django.apps import apps
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
if app_configs is None:
@ -25,7 +25,7 @@ def check_generic_foreign_keys(app_configs=None, **kwargs):
return errors
def check_model_name_lengths(app_configs=None, **kwargs):
def check_model_name_lengths(app_configs, **kwargs):
if app_configs is None:
models = apps.get_models()
else:

View File

@ -8,7 +8,7 @@ E005 = Error(
)
def check_finders(app_configs=None, **kwargs):
def check_finders(app_configs, **kwargs):
"""Check all registered staticfiles finders."""
errors = []
for finder in get_finders():
@ -21,7 +21,7 @@ def check_finders(app_configs=None, **kwargs):
return errors
def check_storages(app_configs=None, **kwargs):
def check_storages(app_configs, **kwargs):
"""Ensure staticfiles is defined in STORAGES setting."""
errors = []
if STATICFILES_STORAGE_ALIAS not in settings.STORAGES:

View File

@ -9,7 +9,7 @@ from django.core.checks import Error, Tags, Warning, register
@register(Tags.models)
def check_all_models(app_configs=None, **kwargs):
def check_all_models(app_configs, **kwargs):
db_table_models = defaultdict(list)
indexes = defaultdict(list)
constraints = defaultdict(list)
@ -223,5 +223,5 @@ def _check_lazy_references(apps, ignore=None):
@register(Tags.models)
def check_lazy_references(app_configs=None, **kwargs):
def check_lazy_references(app_configs, **kwargs):
return _check_lazy_references(apps)