1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2024-12-05 01:26:54 +00:00

sympasoap is not a dependency is test env

This commit is contained in:
Yohann D'ANELLO 2020-10-09 14:18:27 +02:00
parent d62cb40acd
commit 6e8b6fbc66

View File

@ -1,14 +1,13 @@
import os
from sympasoap import Client
_client = None
def get_sympa_client() -> Client:
def get_sympa_client():
global _client
if _client is None:
if os.getenv("SYMPA_PASSWORD", None) is not None:
from sympasoap import Client
_client = Client("https://" + os.getenv("SYMPA_URL"))
_client.login(os.getenv("SYMPA_EMAIL"), os.getenv("SYMPA_PASSWORD"))
else: