Commit 8c4e4f4bdd1f1c6d9b9c6b717962b6274e7223d0
1 parent
06cb2c65
Exists in
master
and in
27 other branches
invite-members: refactor cancelation of invitations after membership
Refactor commit 737f856ef88a810583886ab402e1267e098c54d8. (ActionItem3100)
Showing
2 changed files
with
2 additions
and
1 deletions
Show diff stats
app/models/invite_member.rb
... | ... | @@ -13,7 +13,7 @@ class InviteMember < Invitation |
13 | 13 | end |
14 | 14 | |
15 | 15 | def perform |
16 | - community.add_member(friend) and friend.tasks.pending.of("InviteMember").select { |t| t.data[:community_id] == community_id }.each { |invite| invite.cancel } | |
16 | + community.add_member(friend) | |
17 | 17 | end |
18 | 18 | |
19 | 19 | def title | ... | ... |
app/models/profile.rb
... | ... | @@ -618,6 +618,7 @@ private :generate_url, :url_options |
618 | 618 | self.affiliate(person, Profile::Roles.admin(environment.id)) if members_count == 0 |
619 | 619 | self.affiliate(person, Profile::Roles.member(environment.id)) |
620 | 620 | end |
621 | + person.tasks.pending.of("InviteMember").select { |t| t.data[:community_id] == self.id }.each { |invite| invite.cancel } | |
621 | 622 | else |
622 | 623 | raise _("%s can't have members") % self.class.name |
623 | 624 | end | ... | ... |