]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/actor/actor.ts
Fix SQL query
[github/Chocobozzz/PeerTube.git] / server / models / actor / actor.ts
index 1524e053385397c71fc0d07eeccaba4fcdb510e3..80a646c77f59e669119c61a8337a50d1534353a4 100644 (file)
@@ -381,7 +381,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {
       const query = {
         where: {
           [Op.and]: [
-            this.wherePreferredUsername(preferredUsername),
+            this.wherePreferredUsername(preferredUsername, '"ActorModel"."preferredUsername"'),
             {
               serverId: null
             }
@@ -431,7 +431,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {
 
   static loadByNameAndHost (preferredUsername: string, host: string): Promise<MActorFull> {
     const query = {
-      where: this.wherePreferredUsername(preferredUsername),
+      where: this.wherePreferredUsername(preferredUsername, '"ActorModel"."preferredUsername"'),
       include: [
         {
           model: ServerModel,