Skip to content

Commit

Permalink
Fixes #1596 by ensuring it only shows active members.
Browse files Browse the repository at this point in the history
Currently removing a user from a group/org (marking membership as deleted)
then it still gets returned in dataset/new as a viable organisation/group to
choose when it isn't (as the user is not actually still a member).
  • Loading branch information
rossjones committed Apr 18, 2014
1 parent 9d35add commit 4309aa7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckan/logic/action/get.py
Expand Up @@ -565,7 +565,8 @@ def organization_list_for_user(context, data_dict):
q = model.Session.query(model.Member) \
.filter(model.Member.table_name == 'user') \
.filter(model.Member.capacity.in_(roles)) \
.filter(model.Member.table_id == user_id)
.filter(model.Member.table_id == user_id) \
.filter(model.Member.state == 'active')

group_ids = []
for row in q.all():
Expand Down

0 comments on commit 4309aa7

Please sign in to comment.