2023-09-30 18:17:42 -07:00
|
|
|
from django.conf import settings as django_settings
|
|
|
|
|
|
2024-05-20 09:40:19 -07:00
|
|
|
from paperless.config import GeneralConfig
|
|
|
|
|
|
2023-09-30 18:17:42 -07:00
|
|
|
|
|
|
|
|
def settings(request):
|
2024-05-20 09:40:19 -07:00
|
|
|
general_config = GeneralConfig()
|
|
|
|
|
|
|
|
|
|
app_title = (
|
|
|
|
|
django_settings.APP_TITLE
|
|
|
|
|
if general_config.app_title is None or len(general_config.app_title) == 0
|
|
|
|
|
else general_config.app_title
|
|
|
|
|
)
|
|
|
|
|
app_logo = (
|
|
|
|
|
django_settings.APP_LOGO
|
|
|
|
|
if general_config.app_logo is None or len(general_config.app_logo) == 0
|
2024-11-28 08:11:35 -08:00
|
|
|
else django_settings.BASE_URL + general_config.app_logo.lstrip("/")
|
2024-05-20 09:40:19 -07:00
|
|
|
)
|
|
|
|
|
|
2023-09-30 18:17:42 -07:00
|
|
|
return {
|
2024-12-02 16:12:40 -08:00
|
|
|
"EMAIL_ENABLED": django_settings.EMAIL_ENABLED,
|
2024-02-25 21:17:21 -08:00
|
|
|
"DISABLE_REGULAR_LOGIN": django_settings.DISABLE_REGULAR_LOGIN,
|
2024-07-08 15:38:23 -07:00
|
|
|
"REDIRECT_LOGIN_TO_SSO": django_settings.REDIRECT_LOGIN_TO_SSO,
|
2024-02-26 09:23:53 -08:00
|
|
|
"ACCOUNT_ALLOW_SIGNUPS": django_settings.ACCOUNT_ALLOW_SIGNUPS,
|
2024-02-26 13:41:25 -08:00
|
|
|
"domain": getattr(django_settings, "PAPERLESS_URL", request.get_host()),
|
2024-05-20 09:40:19 -07:00
|
|
|
"APP_TITLE": app_title,
|
|
|
|
|
"APP_LOGO": app_logo,
|
2023-09-30 18:17:42 -07:00
|
|
|
}
|