Skip to content

Commit

Permalink
v0.1.3, fix bug where emails with + don't work on retrieval.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeckennedy committed Jan 21, 2024
1 parent df7867c commit cfb8310
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions listmonk/impl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from listmonk import models, urls # noqa: F401

__version__ = '0.1.2'
__version__ = '0.1.3'

from listmonk.models import SubscriberStatuses

Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies = [
"httpx",
"pydantic",
]
version = "0.1.2"
version = "0.1.3"


[project.urls]
Expand Down

0 comments on commit cfb8310

Please sign in to comment.