From cfb83101db35eab9109cce3c92f52d42a464035f Mon Sep 17 00:00:00 2001 From: Michael Kennedy Date: Sun, 21 Jan 2024 13:33:17 -0800 Subject: [PATCH] v0.1.3, fix bug where emails with + don't work on retrieval. --- listmonk/impl/__init__.py | 5 +++-- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/listmonk/impl/__init__.py b/listmonk/impl/__init__.py index 90a4490..3bbed69 100644 --- a/listmonk/impl/__init__.py +++ b/listmonk/impl/__init__.py @@ -7,7 +7,7 @@ from listmonk import models, urls # noqa: F401 -__version__ = '0.1.2' +__version__ = '0.1.3' from listmonk.models import SubscriberStatuses @@ -176,7 +176,8 @@ def subscriber_by_email(email: str) -> Optional[models.Subscriber]: global core_headers validate_state(url=True, user=True) - url = f"{url_base}{urls.subscribers}?page=1&per_page=100&query=subscribers.email='{email}'" + encoded_email = email.replace('+', '%2b') + url = f"{url_base}{urls.subscribers}?page=1&per_page=100&query=subscribers.email='{encoded_email}'" resp = httpx.get(url, headers=core_headers, follow_redirects=True) resp.raise_for_status() diff --git a/pyproject.toml b/pyproject.toml index 9484fec..6a9537b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "httpx", "pydantic", ] -version = "0.1.2" +version = "0.1.3" [project.urls]