chore: fix the failing user destroy for admin (#3223)

- fix the invitee association on the user
- handle Instagram events with inbox missing
This commit is contained in:
Sojan Jose
2021-10-16 00:11:53 +05:30
committed by GitHub
parent de0702b679
commit 3b53ca157c
4 changed files with 8 additions and 3 deletions

View File

@@ -38,7 +38,9 @@ class Webhooks::InstagramEventsJob < ApplicationJob
def create_test_text
messenger_channel = Channel::FacebookPage.last
@inbox = ::Inbox.find_by!(channel: messenger_channel)
@inbox = ::Inbox.find_by(channel: messenger_channel)
return unless @inbox
@contact_inbox = @inbox.contact_inboxes.where(source_id: 'sender_username').first
unless @contact_inbox
@contact_inbox ||= @inbox.channel.create_contact_inbox(