Add tests when getting a blacklisted video

This commit is contained in:
Chocobozzz
2018-08-14 09:16:32 +02:00
parent 191764f30b
commit e5e7f7fe99
2 changed files with 50 additions and 11 deletions

View File

@@ -138,6 +138,8 @@ class Emailer {
async addVideoUnblacklistReportJob (videoId: number) {
const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
if (!video) throw new Error('Unknown Video id during Blacklist report.')
// It's not our user
if (video.remote === true) return
const user = await UserModel.loadById(video.VideoChannel.Account.userId)