diff --git a/src/dns.py b/src/dns.py index 318a5fcde..0b002d912 100644 --- a/src/dns.py +++ b/src/dns.py @@ -35,7 +35,6 @@ from moulinette.utils.log import getActionLogger from moulinette.utils.filesystem import read_file, write_to_file, read_toml, mkdir from yunohost.domain import ( - domain_list, _assert_domain_exists, domain_config_get, _get_domain_settings, diff --git a/src/domain.py b/src/domain.py index e79d5acfd..5e338f4d4 100644 --- a/src/domain.py +++ b/src/domain.py @@ -25,7 +25,7 @@ """ import os import time -from typing import List +from typing import List, Optional from collections import OrderedDict from moulinette import m18n, Moulinette @@ -53,7 +53,7 @@ DOMAIN_SETTINGS_DIR = "/etc/yunohost/domains" # yunohost CLI and API which run in different processes domain_list_cache: List[str] = [] domain_list_cache_timestamp = 0 -main_domain_cache: str = None +main_domain_cache: Optional[str] = None main_domain_cache_timestamp = 0 DOMAIN_CACHE_DURATION = 15 diff --git a/src/tests/test_ldapauth.py b/src/tests/test_ldapauth.py index db5229342..25184ceac 100644 --- a/src/tests/test_ldapauth.py +++ b/src/tests/test_ldapauth.py @@ -49,7 +49,7 @@ def test_authenticate_with_user_who_is_not_admin(): with pytest.raises(MoulinetteError) as exception: LDAPAuth().authenticate_credentials(credentials="bob:test123Ynh") - translation = m18n.n("invalid_password") + translation = m18n.n("invalid_credentials") expected_msg = translation.format() assert expected_msg in str(exception) @@ -58,7 +58,7 @@ def test_authenticate_with_wrong_password(): with pytest.raises(MoulinetteError) as exception: LDAPAuth().authenticate_credentials(credentials="alice:bad_password_lul") - translation = m18n.n("invalid_password") + translation = m18n.n("invalid_credentials") expected_msg = translation.format() assert expected_msg in str(exception) @@ -78,7 +78,7 @@ def test_authenticate_change_password(): with pytest.raises(MoulinetteError) as exception: LDAPAuth().authenticate_credentials(credentials="alice:Yunohost") - translation = m18n.n("invalid_password") + translation = m18n.n("invalid_credentials") expected_msg = translation.format() assert expected_msg in str(exception)