Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #14

Merged
merged 4 commits into from
Jul 20, 2023
Merged

Fixes #14

merged 4 commits into from
Jul 20, 2023

Conversation

jheidecker
Copy link
Contributor

GetSiteResponse looks to prepare "all_languages" based on the "site" endpoint using the "Language" object. The language object is [code,id,name] which matches the published API, BUT GetSiteResponse is trying to use "discussion_languages" which is just a list of [id]s.

Attempting to enumerate anything from the site endpoint with GetSiteResponse illicits an error:

TypeError: plemmy.objects.Language() argument after ** must be a mapping, not int

I believe this is a typo or perhaps human error in the lemmy api docs, or transposing from those docs. This PR changes "discussion_languages" to "all languages," and (if it's required) adds "discussion_languages" to return a list of language id's from "site" in the same way GetCommunityResponse does from "community."

@jheidecker
Copy link
Contributor Author

Continuing to implement and debug. GetPostResponse was enumerating moderators to a single CommunityModeratorView illiciting error:

TypeError: list indices must be integers or slices, not str

Changed this to return CommunityModeratorView for each moderator in moderators.

@jheidecker jheidecker changed the title Fix GetSiteResponse Fixes Jul 20, 2023
@tjkessler
Copy link
Collaborator

@jheidecker,

Nice finds! Probably errors on my part from the transposition 🥴 I'll go ahead and merge, new update will be 0.3.2!

Travis

@tjkessler tjkessler merged commit ede7c80 into Fedihosting-Foundation:main Jul 20, 2023
@tjkessler tjkessler added the bug Something isn't working label Jul 20, 2023
@tjkessler tjkessler self-assigned this Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants