Commit dc33677965f0c7ab085395ca2ac305dbe2093160
1 parent
d69788f1
Exists in
master
and in
29 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,7 +13,7 @@ class InviteMember < Invitation | ||
13 | end | 13 | end |
14 | 14 | ||
15 | def perform | 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 | end | 17 | end |
18 | 18 | ||
19 | def title | 19 | def title |
app/models/profile.rb
@@ -629,6 +629,7 @@ private :generate_url, :url_options | @@ -629,6 +629,7 @@ private :generate_url, :url_options | ||
629 | self.affiliate(person, Profile::Roles.admin(environment.id)) if members.count == 0 | 629 | self.affiliate(person, Profile::Roles.admin(environment.id)) if members.count == 0 |
630 | self.affiliate(person, Profile::Roles.member(environment.id)) | 630 | self.affiliate(person, Profile::Roles.member(environment.id)) |
631 | end | 631 | end |
632 | + person.tasks.pending.of("InviteMember").select { |t| t.data[:community_id] == self.id }.each { |invite| invite.cancel } | ||
632 | else | 633 | else |
633 | raise _("%s can't have members") % self.class.name | 634 | raise _("%s can't have members") % self.class.name |
634 | end | 635 | end |