Move helloasso methods in a specific module

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-02-25 15:11:33 +01:00
parent 01ba0a1df9
commit 92408b359b
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 3 additions and 2 deletions

View File

@ -6,14 +6,15 @@ from datetime import datetime, timedelta
from django.conf import settings
import requests
_access_token = None
_refresh_token = None
_expires_at = None
def _get_hello_asso_api_base_url():
if not settings.DEBUG:
if settings.HELLOASSO_TEST_ENDPOINT:
return f"{settings.HELLOASSO_TEST_ENDPOINT_URL}/helloasso-test"
elif not settings.DEBUG:
return "https://api.helloasso.com"
else:
return "https://api.helloasso-sandbox.com"