From b20d7eca03b44080530558cab0d406f0a0e3ae0d Mon Sep 17 00:00:00 2001 From: Daniel Quinn Date: Sun, 23 Sep 2018 14:01:15 +0100 Subject: [PATCH] Tweak settings.py to allow for TRUST-based PostgreSQL auth --- src/paperless/settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 433eabe88..4e788e56b 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -144,13 +144,14 @@ DATABASES = { } } -if os.getenv("PAPERLESS_DBUSER") and os.getenv("PAPERLESS_DBPASS"): +if os.getenv("PAPERLESS_DBUSER"): DATABASES["default"] = { "ENGINE": "django.db.backends.postgresql_psycopg2", "NAME": os.getenv("PAPERLESS_DBNAME", "paperless"), "USER": os.getenv("PAPERLESS_DBUSER"), - "PASSWORD": os.getenv("PAPERLESS_DBPASS") } + if os.getenv("PAPERLESS_DBPASS"): + DATABASES["default"]["PASSWORD"] = os.getenv("PAPERLESS_DBPASS") # Password validation