Skip to content

Commit

Permalink
a handful of small fixes for merge !7
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Käser committed Aug 6, 2015
1 parent f76727d commit 8843df1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions ipynbsrv/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def save(self, commit=True):
for admin in self.cleaned_data['admins']:
group.add_admin(admin)
# users
for user in group.get_members():
for user in group.get_users():
if user not in self.cleaned_data['users']:
group.remove_member(user)
group.remove_user(user)
for user in self.cleaned_data['users']:
group.add_member(user)
group.add_user(user)
else:
old_save_m2m = self.save_m2m

Expand All @@ -62,11 +62,11 @@ def new_save_m2m():
for admin in self.cleaned_data['admins']:
group.add_admin(admin)
# users
for user in group.get_members():
for user in group.get_users():
if user not in self.cleaned_data['users']:
group.remove_member(user)
group.remove_user(user)
for user in self.cleaned_data['users']:
group.add_member(user)
group.add_user(user)
self.save_m2m = new_save_m2m
return group

Expand Down
6 changes: 3 additions & 3 deletions ipynbsrv/core/signals/shares.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ def remove_group_members_from_share_group(sender, share, group, **kwargs):
if share is not None and group is not None:
for member in group.get_members():
leave = False
if user == share.owner:
if member == share.owner:
leave = True
else:
for access_group in share.access_groups.all():
if access_group != group:
if access_group.has_access(user):
if access_group.has_access(member):
leave = True
break
if not leave:
share.remove_member(user)
share.remove_member(member)


@receiver(collaboration_group_member_removed)
Expand Down

0 comments on commit 8843df1

Please sign in to comment.