]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-abuse.ts
Destroy user token when changing its role
[github/Chocobozzz/PeerTube.git] / server / models / video / video-abuse.ts
index d0ee969fb10c89f13fdba06c1cd880c9ce60507c..182971c4e018a2aa8aa0735d94a71940814c0d2e 100644 (file)
@@ -3,7 +3,6 @@ import { VideoAbuseObject } from '../../../shared/models/activitypub/objects'
 import { isVideoAbuseReasonValid } from '../../helpers/custom-validators/videos'
 import { CONFIG } from '../../initializers'
 import { AccountModel } from '../account/account'
-import { ServerModel } from '../server/server'
 import { getSort, throwIfNotValid } from '../utils'
 import { VideoModel } from './video'
 
@@ -63,13 +62,7 @@ export class VideoAbuseModel extends Model<VideoAbuseModel> {
       include: [
         {
           model: AccountModel,
-          required: true,
-          include: [
-            {
-              model: ServerModel,
-              required: false
-            }
-          ]
+          required: true
         },
         {
           model: VideoModel,
@@ -87,8 +80,8 @@ export class VideoAbuseModel extends Model<VideoAbuseModel> {
   toFormattedJSON () {
     let reporterServerHost
 
-    if (this.Account.Server) {
-      reporterServerHost = this.Account.Server.host
+    if (this.Account.Actor.Server) {
+      reporterServerHost = this.Account.Actor.Server.host
     } else {
       // It means it's our video
       reporterServerHost = CONFIG.WEBSERVER.HOST