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

- Fix an issue on catalogue APIs when looking for Public Groups IDs #3356

Merged
merged 2 commits into from
Oct 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions geonode/catalogue/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,13 @@ def csw_global_dispatch(request):
for group in request.user.groups.all():
groups_ids.append(group.id)

public_groups = GroupProfile.objects.exclude(access="private").values('group')
public_groups = GroupProfile.objects.exclude(access="private").values('group').distinct()
for group in public_groups:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which is the case when we have more than one group per GroupProfile?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no case, you are right. It is a refuse. Removing. Thanks @simod

groups_ids.append(group.id)
if isinstance(group, dict):
if 'group' in group:
groups_ids.append(group['group'])
else:
groups_ids.append(group.id)

if len(groups_ids) > 0:
groups = "(" + (", ".join(str(e) for e in groups_ids)) + ")"
Expand Down