Fixed server recordings 500 if user doesn't have an email (#1254)

Co-authored-by: Jesus Federico <jesus@123it.ca>
This commit is contained in:
Ahmad Farhat 2020-04-16 12:31:57 -04:00 committed by GitHub
parent 3b8b1abb59
commit 2f41b02e72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -88,7 +88,7 @@ module Recorder
r[:name].downcase.include?(search)) ||
r[:participants].include?(search) ||
!r[:playbacks].select { |p| p[:type].downcase.include?(search) }.empty? ||
(search_name && Room.find_by(bbb_id: r[:meetingID]).owner.email.downcase.include?(search))
(search_name && recording_owner(r[:meetingID]).downcase.include?(search))
end
end
@ -122,4 +122,11 @@ module Recorder
recs.reverse
end
end
private
# Gets the email of the room owner to which the recording belongs to
def recording_owner(room_id)
Room.find_by(bbb_id: room_id).owner.email.presence || Room.find_by(bbb_id: room_id).owner.username
end
end

View File

@ -21,7 +21,7 @@ module AdminsHelper
# Gets the email of the room owner to which the recording belongs to
def recording_owner_email(room_id)
Room.find_by(bbb_id: room_id).owner.email
Room.find_by(bbb_id: room_id).owner.email.presence || Room.find_by(bbb_id: room_id).owner.username
end
def admin_invite_registration