FIX: directly check on post if we have an event
This is cleaner and also avoids a 404 when no event is found
This commit is contained in:
parent
214899ea9a
commit
ed37c5bcc7
|
@ -509,11 +509,8 @@ after_initialize do
|
||||||
ids = []
|
ids = []
|
||||||
post = post_revision.post
|
post = post_revision.post
|
||||||
|
|
||||||
if post && post.is_first_post?
|
if post && post.is_first_post? && post.event
|
||||||
event = DiscoursePostEvent::Event.find(post.id)
|
ids.concat(post.event.currently_attending_invitees.pluck(:user_id))
|
||||||
if event
|
|
||||||
ids.concat(event.currently_attending_invitees.pluck(:user_id))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
ids
|
ids
|
||||||
|
|
Loading…
Reference in New Issue