]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/activitypub/actor.ts
Fix travis tests
[github/Chocobozzz/PeerTube.git] / server / models / activitypub / actor.ts
index 269149a314dd12e150b76812ab2f2cd027047778..38a689fea5da9ac7481d3c5480c5b188077bdfd8 100644 (file)
@@ -2,14 +2,31 @@ import { values } from 'lodash'
 import { extname } from 'path'
 import * as Sequelize from 'sequelize'
 import {
-  AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, DefaultScope, ForeignKey, HasMany, HasOne, Is, IsUUID, Model, Scopes,
-  Table, UpdatedAt
+  AllowNull,
+  BelongsTo,
+  Column,
+  CreatedAt,
+  DataType,
+  Default,
+  DefaultScope,
+  ForeignKey,
+  HasMany,
+  HasOne,
+  Is,
+  IsUUID,
+  Model,
+  Scopes,
+  Table,
+  UpdatedAt
 } from 'sequelize-typescript'
 import { ActivityPubActorType } from '../../../shared/models/activitypub'
 import { Avatar } from '../../../shared/models/avatars/avatar.model'
 import { activityPubContextify } from '../../helpers/activitypub'
 import {
-  isActorFollowersCountValid, isActorFollowingCountValid, isActorPreferredUsernameValid, isActorPrivateKeyValid,
+  isActorFollowersCountValid,
+  isActorFollowingCountValid,
+  isActorPreferredUsernameValid,
+  isActorPrivateKeyValid,
   isActorPublicKeyValid
 } from '../../helpers/custom-validators/activitypub/actor'
 import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
@@ -71,6 +88,12 @@ enum ScopeNames {
     },
     {
       fields: [ 'inboxUrl', 'sharedInboxUrl' ]
+    },
+    {
+      fields: [ 'serverId' ]
+    },
+    {
+      fields: [ 'avatarId' ]
     }
   ]
 })
@@ -389,7 +412,7 @@ export class ActorModel extends Model<ActorModel> {
           attribute: [],
           model: ActorFollowModel.unscoped(),
           required: true,
-          as: 'ActorFollowers',
+          as: 'ActorFollowing',
           where: {
             state: 'accepted',
             targetActorId: this.id