Skip to content

Commit

Permalink
Fix issue with Paste.save not storing site if passed in
Browse files Browse the repository at this point in the history
  • Loading branch information
zevaryx committed Mar 30, 2022
1 parent f24fdab commit 7c6a959
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pastypy/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ async def save(self, site: Optional[str] = "https://pasty.lus.pm") -> str:
Returns:
Modification token
"""
site = self._site or site
endpoint = site + "/api/v2/pastes"
if not self._site:
self._site = site
endpoint = self._site + "/api/v2/pastes"

payload = {
"content": self._content,
Expand Down
6 changes: 3 additions & 3 deletions pastypy/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def save(self, site: Optional[str] = "https://pasty.lus.pm") -> str:
Returns:
Modification token
"""
site = self._site or site
self._site = site
endpoint = site + "/api/v2/pastes"
if not self._site:
self._site = site
endpoint = self._site + "/api/v2/pastes"

payload = {
"content": self._content,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pastypy"
version = "1.0.1"
version = "1.0.2"
description = "Pasty API wrapper"
authors = ["Zevaryx <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 7c6a959

Please sign in to comment.