Skip to content

Commit

Permalink
Merge pull request #36 from db0/fix-create-community
Browse files Browse the repository at this point in the history
fix create community
  • Loading branch information
NicKoehler authored Jun 29, 2023
2 parents 8020151 + b586d3d commit 6b4bf8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/pic.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
if not lemmy_password:
raise Exception("You need to provide a lemmy password via env var or arg")

lemmy = Lemmy(f"https://{lemmy_domain}")
lemmy = Lemmy(f"http://{lemmy_domain}")
if not lemmy.log_in(lemmy_username, lemmy_password):
print("Failed to log in")
exit(1)
Expand Down
6 changes: 3 additions & 3 deletions pythorhead/community.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Optional
from typing import Any, List, Optional

from pythorhead.requestor import Request, Requestor
from pythorhead.types import ListingType, SortType
Expand Down Expand Up @@ -31,7 +31,7 @@ def create(
Returns:
Optional[dict]: post data if successful
"""
new_community: dict = {
new_community: dict[Any, Any] = {
"name": name,
"title": title,
}
Expand All @@ -44,7 +44,7 @@ def create(
if [posting_restricted_to_mods] is not None:
new_community["[posting_restricted_to_mods]"] = [posting_restricted_to_mods]

return self._requestor.api(Request.POST, "/post", json=new_community)
return self._requestor.api(Request.POST, "/community", json=new_community)

def get(self, id: Optional[int] = None, name: Optional[str] = None) -> Optional[dict]:
"""
Expand Down

0 comments on commit 6b4bf8f

Please sign in to comment.