MCPcopy
hub / github.com/django/django / handle

Method handle

django/core/management/commands/check.py:52–88  ·  view source on GitHub ↗
(self, *app_labels, **options)

Source from the content-addressed store, hash-verified

50 )
51
52 def handle(self, *app_labels, **options):
53 include_deployment_checks = options["deploy"]
54 if options["list_tags"]:
55 self.stdout.write(
56 "\n".join(sorted(registry.tags_available(include_deployment_checks)))
57 )
58 return
59
60 if app_labels:
61 app_configs = [apps.get_app_config(app_label) for app_label in app_labels]
62 else:
63 app_configs = None
64
65 tags = options["tags"]
66 if tags:
67 try:
68 invalid_tag = next(
69 tag
70 for tag in tags
71 if not checks.tag_exists(tag, include_deployment_checks)
72 )
73 except StopIteration:
74 # no invalid tags
75 pass
76 else:
77 raise CommandError(
78 'There is no system check with the "%s" tag.' % invalid_tag
79 )
80
81 self.check(
82 app_configs=app_configs,
83 tags=tags,
84 display_num_errors=True,
85 include_deployment_checks=include_deployment_checks,
86 fail_level=getattr(checks, options["fail_level"]),
87 databases=options["databases"],
88 )

Callers

nothing calls this directly

Calls 7

CommandErrorClass · 0.90
tags_availableMethod · 0.80
get_app_configMethod · 0.80
tag_existsMethod · 0.80
writeMethod · 0.45
joinMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected