Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions ckanext/discourse/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,8 @@ def discourse_comments(self, pkg_dict=None):
return ''

def discourse_comments_count(self, pkg_dict=None):
"""Get comment count from Discourse."""
try:
pkg = pkg_dict or toolkit.g.pkg_dict
topic_id = pkg.get('topic_id')

if not (self.settings and topic_id):
return 0

api = DiscourseApi(self.settings)
count = api.get_topic_comment_count(topic_id)
return count

except Exception as e:
log.error(f"Error getting comment count: {str(e)}")
return 0
"""Disabled: always return 0; never touches g.pkg_dict or calls HTTP."""
return 0

def discourse_is_configured(self):
"""Check if Discourse is properly configured."""
Expand Down