epok-toolkit 1.5.0__py3-none-any.whl → 1.5.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of epok-toolkit might be problematic. Click here for more details.
- epok_toolkit/messaging/whatsapp_instanced.py +11 -15
- {epok_toolkit-1.5.0.dist-info → epok_toolkit-1.5.2.dist-info}/METADATA +1 -1
- {epok_toolkit-1.5.0.dist-info → epok_toolkit-1.5.2.dist-info}/RECORD +6 -6
- {epok_toolkit-1.5.0.dist-info → epok_toolkit-1.5.2.dist-info}/WHEEL +0 -0
- {epok_toolkit-1.5.0.dist-info → epok_toolkit-1.5.2.dist-info}/licenses/LICENSE +0 -0
- {epok_toolkit-1.5.0.dist-info → epok_toolkit-1.5.2.dist-info}/top_level.txt +0 -0
|
@@ -3,24 +3,20 @@ from django.conf import settings
|
|
|
3
3
|
from celery import shared_task
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
API_KEY = settings.API_KEY
|
|
7
|
+
INSTANCE = settings.INSTANCE
|
|
8
|
+
SERVER_URL = settings.SERVER_URL
|
|
6
9
|
|
|
7
|
-
@shared_task
|
|
8
|
-
bind=True,
|
|
9
|
-
autoretry_for=(ConnectionError, TimeoutError),
|
|
10
|
-
retry_backoff=True, # 2, 4, 8, 16… s
|
|
11
|
-
retry_jitter=True, # +- aleatorio
|
|
12
|
-
max_retries=3,
|
|
13
|
-
ignore_result=True, # <-- ¡importante!
|
|
14
|
-
)
|
|
10
|
+
@shared_task
|
|
15
11
|
def send_whatsapp_message_async(number: str, message: str):
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
INSTANCE = settings.INSTANCE
|
|
20
|
-
SERVER_URL = settings.SERVER_URL
|
|
12
|
+
try:
|
|
13
|
+
from colorstreak import log
|
|
14
|
+
log.debug(f"Enviando mensaje a {number}: '{message}'")
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
client = WhatsappClient(api_key=API_KEY, server_url=SERVER_URL, instance_name=INSTANCE)
|
|
17
|
+
return client.send_text(number, message)
|
|
18
|
+
except Exception as e:
|
|
19
|
+
log.error(f"Error al enviar mensaje a {number}: {e}")
|
|
24
20
|
|
|
25
21
|
def send_text(number: str, message: str):
|
|
26
22
|
from colorstreak import log
|
|
@@ -7,7 +7,7 @@ epok_toolkit/email/engine.py,sha256=IIifqRI9z76pHdrO5oSSZ25aP5txOTAgrj1JuVVPlMY,
|
|
|
7
7
|
epok_toolkit/email/templates.py,sha256=uO3gYn2iiGxcjxioaG066gGPts1m-3C1Gp7XatGgVOg,7578
|
|
8
8
|
epok_toolkit/messaging/__init__.py,sha256=AL9bL5fmVZx3ZvdzBWaVgvBJVnRuyYzrCp13txNTc3Q,41
|
|
9
9
|
epok_toolkit/messaging/whatsapp.py,sha256=TrMSiKzvnhWOotSDEGil1BGgOJ7jLK7h3MXKdW3zCJw,14114
|
|
10
|
-
epok_toolkit/messaging/whatsapp_instanced.py,sha256=
|
|
10
|
+
epok_toolkit/messaging/whatsapp_instanced.py,sha256=fv2UuRHb6rLjTJ4AZCca3O8Evto_eiBo1MP81nggdPE,788
|
|
11
11
|
epok_toolkit/pdf/__init__.py,sha256=Scb1iOYnVIUEiUVHLNaPmcigyD-jOSBs3ws5RmolMKE,33
|
|
12
12
|
epok_toolkit/pdf/ticket_pdf.py,sha256=ce21N7OyaSQkfZvOL4c0mEFv7XSGajlOzL-gNb8vBro,8989
|
|
13
13
|
epok_toolkit/pdf/fuentes/Kollektif-Bold.ttf,sha256=MiaucCL_aPGhbDl6M0xA2g2nf84MXHGciOd-XSw0XRo,78780
|
|
@@ -16,8 +16,8 @@ epok_toolkit/pdf/fuentes/Kollektif-Italic.ttf,sha256=1CXPyw43il9u0tQ_7aRzsEaVtg3
|
|
|
16
16
|
epok_toolkit/pdf/fuentes/Kollektif.ttf,sha256=7wTLkVVNUm1giLjIZcWRUH5r2r3o0GjdKic4V1A-pNQ,51128
|
|
17
17
|
epok_toolkit/pdf/plantillas/Ticket_congrats.png,sha256=OSQhVR0j_nLHE6kSJ33BTR-77HM1fNAfJBe2EuX6wVk,157141
|
|
18
18
|
epok_toolkit/pdf/plantillas/Ticket_congrats2.png,sha256=1RBogBdo-8WSMpD3H73HoLgJtr5EC5oVKfOCIWOxPSo,373605
|
|
19
|
-
epok_toolkit-1.5.
|
|
20
|
-
epok_toolkit-1.5.
|
|
21
|
-
epok_toolkit-1.5.
|
|
22
|
-
epok_toolkit-1.5.
|
|
23
|
-
epok_toolkit-1.5.
|
|
19
|
+
epok_toolkit-1.5.2.dist-info/licenses/LICENSE,sha256=iLDbGXdLSIOT5OsxzHCvtmxHtonE21GiFlS3LNkug4A,128
|
|
20
|
+
epok_toolkit-1.5.2.dist-info/METADATA,sha256=xckzx1LsdYeSbO73pXieyrZqqBB6GsrRFXKzK23DL4s,739
|
|
21
|
+
epok_toolkit-1.5.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
epok_toolkit-1.5.2.dist-info/top_level.txt,sha256=Wo72AqIFcfWwBGM5F5iGFw9PrO3WBnTSprFZIJk_pNg,13
|
|
23
|
+
epok_toolkit-1.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|