From bc7b7f3552a80e4042788e3be8a9ddcb11bb8b74 Mon Sep 17 00:00:00 2001 From: Jay Heidecker Date: Thu, 20 Jul 2023 12:30:51 -0600 Subject: [PATCH 1/4] fixed error in GetSiteResponse --- plemmy/responses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plemmy/responses.py b/plemmy/responses.py index a3aa7c8..23cd177 100644 --- a/plemmy/responses.py +++ b/plemmy/responses.py @@ -318,7 +318,7 @@ def __init__(self, api_response: requests.Response) -> None: response = api_response.json() self.admins = [PersonView(a) for a in response["admins"]] self.all_languages = [Language(**lang) - for lang in response["discussion_languages"]] + for lang in response["all_languages"]] if "my_user" in response.keys(): self.my_user = response["my_user"] else: From 96c6908ea44739825c8be1043115a90f38cc38dd Mon Sep 17 00:00:00 2001 From: Jay Heidecker Date: Thu, 20 Jul 2023 12:53:12 -0600 Subject: [PATCH 2/4] return discussion_languages from site --- plemmy/responses.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plemmy/responses.py b/plemmy/responses.py index 23cd177..0553f56 100644 --- a/plemmy/responses.py +++ b/plemmy/responses.py @@ -319,6 +319,7 @@ def __init__(self, api_response: requests.Response) -> None: self.admins = [PersonView(a) for a in response["admins"]] self.all_languages = [Language(**lang) for lang in response["all_languages"]] + self.discussion_languages = response["discussion_languages"] if "my_user" in response.keys(): self.my_user = response["my_user"] else: From c5292154fc5358222c258c781467626280e82929 Mon Sep 17 00:00:00 2001 From: Jay Heidecker Date: Thu, 20 Jul 2023 13:23:37 -0600 Subject: [PATCH 3/4] fixed GetPostResponse --- plemmy/responses.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plemmy/responses.py b/plemmy/responses.py index 0553f56..ee4e0ed 100644 --- a/plemmy/responses.py +++ b/plemmy/responses.py @@ -259,9 +259,10 @@ class GetPostResponse(object): def __init__(self, api_response: requests.Response) -> None: response = api_response.json() + print(response) self.community_view = CommunityView(response["community_view"]) self.cross_posts = [PostView(p) for p in response["cross_posts"]] - self.moderators = CommunityModeratorView(response["moderators"]) + self.moderators = [CommunityModeratorView(m) for m in response["moderators"]] self.post_view = PostView(response["post_view"]) From ed10880138ab1202e76ea067c756937b6a963e67 Mon Sep 17 00:00:00 2001 From: Jay Heidecker Date: Thu, 20 Jul 2023 13:24:34 -0600 Subject: [PATCH 4/4] removed debugging --- plemmy/responses.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plemmy/responses.py b/plemmy/responses.py index ee4e0ed..b0c9b70 100644 --- a/plemmy/responses.py +++ b/plemmy/responses.py @@ -259,7 +259,6 @@ class GetPostResponse(object): def __init__(self, api_response: requests.Response) -> None: response = api_response.json() - print(response) self.community_view = CommunityView(response["community_view"]) self.cross_posts = [PostView(p) for p in response["cross_posts"]] self.moderators = [CommunityModeratorView(m) for m in response["moderators"]]