File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -115,10 +115,9 @@ def invitee_uniqueness_for_event
115115 end
116116
117117 def ensure_community_membership! ( person )
118- return unless event &. creator &. community
118+ community = BetterTogether :: Community . find_by ( host : true )
119119
120- community = event . creator . community
121- return if community . person_community_memberships . exists? ( member : person )
120+ return unless community
122121
123122 # Create community membership for the invitee
124123 default_role = BetterTogether ::Role . find_by ( identifier : 'community_member' )
Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ def primary_community_extra_attrs
4848 { }
4949 end
5050
51+ # Backwards-compatible accessor used in tests and callers expecting a `primary_community` method
52+ def primary_community
53+ community
54+ end
55+
5156 def after_record_created ; end
5257
5358 def to_s
You can’t perform that action at this time.
0 commit comments