Skip to content

Commit

Permalink
Merge pull request ckan#8449 from tino097/8438-user-details-break-gro…
Browse files Browse the repository at this point in the history
…up-page

User details break group display
  • Loading branch information
amercader authored Sep 27, 2024
2 parents f13a00b + 66ac1f4 commit 7e5f6a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changes/8438.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Template helper `member_count` will return 0
for unauthorized users.
5 changes: 4 additions & 1 deletion ckan/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2018,7 +2018,10 @@ def member_count(group: str) -> int:
u'id': group,
u'object_type': u'user'
}
return len(logic.get_action(u'member_list')(context, data_dict))
try:
return len(logic.get_action(u'member_list')(context, data_dict))
except logic.NotAuthorized:
return 0


@core_helper
Expand Down

0 comments on commit 7e5f6a8

Please sign in to comment.