]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/videos/video-channels.ts
Merge branch 'release/3.2.0' into develop
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / videos / video-channels.ts
index 57ac548b9d2e20b4c6843e842c5bf86e837cbacb..e881f0d3eb404482b45de83d0243223df3a4a56d 100644 (file)
@@ -3,6 +3,7 @@ import { body, param, query } from 'express-validator'
 import { VIDEO_CHANNELS } from '@server/initializers/constants'
 import { MChannelAccountDefault, MUser } from '@server/types/models'
 import { UserRight } from '../../../../shared'
+import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
 import { isActorPreferredUsernameValid } from '../../../helpers/custom-validators/activitypub/actor'
 import { isBooleanValid, toBooleanOrNull } from '../../../helpers/custom-validators/misc'
 import {
@@ -12,10 +13,9 @@ import {
 } from '../../../helpers/custom-validators/video-channels'
 import { logger } from '../../../helpers/logger'
 import { doesLocalVideoChannelNameExist, doesVideoChannelNameWithHostExist } from '../../../helpers/middlewares'
-import { ActorModel } from '../../../models/activitypub/actor'
+import { ActorModel } from '../../../models/actor/actor'
 import { VideoChannelModel } from '../../../models/video/video-channel'
 import { areValidationErrors } from '../utils'
-import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
 
 const videoChannelsAddValidator = [
   body('name').custom(isActorPreferredUsernameValid).withMessage('Should have a valid channel name'),
@@ -73,13 +73,11 @@ const videoChannelsUpdateValidator = [
     if (res.locals.videoChannel.Actor.isOwned() === false) {
       return res.status(HttpStatusCode.FORBIDDEN_403)
         .json({ error: 'Cannot update video channel of another server' })
-        .end()
     }
 
     if (res.locals.videoChannel.Account.userId !== res.locals.oauth.token.User.id) {
       return res.status(HttpStatusCode.FORBIDDEN_403)
         .json({ error: 'Cannot update video channel of another user' })
-        .end()
     }
 
     return next()