Debian Codegraph @

allauth/headless/checks.py

raw
1 from __future__ import annotations
2
3 from django.core.checks import Critical, register
4
5
6 @register()
7 def settings_check(app_configs, **kwargs) -> list:
8 from allauth.headless import app_settings
9
10 ret = []
11 if app_settings.SERVE_SPECIFICATION:
12 try:
13 import yaml # noqa
14 except ImportError:
15 ret.append(
16 Critical(
17 msg="HEADLESS_SERVE_SPECIFICATION requires the django-allauth[headless-spec] extra to be installed"
18 )
19 )
20 return ret