Coverage for src/django_global_search/apps.py: 92%

1"""Django Global Search AppConfig."""

2

3 from django.apps import AppConfig

4 from django.utils.translation import gettext_lazy as _

5

6 from django_global_search.admin import inject_default_admin_site

7

8

9 class DjangoGlobalSearchConfig(AppConfig): # noqa: D101

10 default_auto_field = "django.db.models.BigAutoField"

11 name = "django_global_search"

12 verbose_name = _("Django Global Search")

13

14 def ready(self): # noqa: D102

15 from django_global_search.settings import global_search_settings

16

17 if not global_search_settings.inject_default_admin_site_enabled:

18 return

19

20 inject_default_admin_site()