Skip to content

Commit

Permalink
Merge pull request #58 from Sebastian2023/fix_category
Browse files Browse the repository at this point in the history
Fix getting category details
  • Loading branch information
bennylope committed Apr 18, 2022
2 parents 1d74e2f + 3b7b7d2 commit 457abc5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/pydiscourse/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,25 +909,18 @@ def categories(self, **kwargs):
"""
return self._get("/categories.json", **kwargs)["category_list"]["categories"]

# Depecreated
# Returns a 302 on recent Discourse version
# Use category_topics instead
# See https://github.com/discourse/discourse_api/pull/94
def category(self, name, parent=None, **kwargs):
def category(self, category_id, parent=None, **kwargs):
"""
Args:
name:
parent:
category_id:
**kwargs:
Returns:
"""
if parent:
name = u"{0}/{1}".format(parent, name)

return self._get(u"/category/{0}.json".format(name), **kwargs)
return self._get(u"/c/{0}/show.json".format(category_id), **kwargs)

def delete_category(self, category_id, **kwargs):
"""
Expand Down

0 comments on commit 457abc5

Please sign in to comment.