From deaff71188606646966ab774387455732a7f6695 Mon Sep 17 00:00:00 2001 From: Johannes Nussbaum Date: Mon, 16 Oct 2023 17:49:37 +0200 Subject: [PATCH] edit --- dsp_permissions_scripts/utils/authentication.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dsp_permissions_scripts/utils/authentication.py b/dsp_permissions_scripts/utils/authentication.py index 173caef6..0d8cde47 100644 --- a/dsp_permissions_scripts/utils/authentication.py +++ b/dsp_permissions_scripts/utils/authentication.py @@ -29,8 +29,11 @@ def _get_login_credentials(host: str) -> tuple[str, str]: else: user = os.getenv("DSP_USER_EMAIL") or "" pw = os.getenv("DSP_USER_PASSWORD") or "" - assert user - assert pw + if not user or not pw: + raise NameError( + "Missing credentials: Your username/password could not be retrieved. " + "Please define 'DSP_USER_EMAIL' and 'DSP_USER_PASSWORD' in the file '.env'." + ) return user, pw