Skip to content

Commit

Permalink
Add fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroel committed Oct 31, 2016
1 parent 636cf96 commit c1b31a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plone/api/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def get_groups(username=None, user=None):
group_tool = portal.get_tool('portal_groups')

if user:
if not getattr(user, 'portal_groups', None):
return []
groups = group_tool.getGroupsForPrincipal(user)
return [get(groupname=group) for group in groups]

Expand Down

0 comments on commit c1b31a0

Please sign in to comment.