diff options
Diffstat (limited to 'server/models/account/account.ts')
-rw-r--r-- | server/models/account/account.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/server/models/account/account.ts b/server/models/account/account.ts index 5bf29f45a..ec4e8d946 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts | |||
@@ -37,8 +37,8 @@ import { ActorImageModel } from '../actor/actor-image' | |||
37 | import { ApplicationModel } from '../application/application' | 37 | import { ApplicationModel } from '../application/application' |
38 | import { ServerModel } from '../server/server' | 38 | import { ServerModel } from '../server/server' |
39 | import { ServerBlocklistModel } from '../server/server-blocklist' | 39 | import { ServerBlocklistModel } from '../server/server-blocklist' |
40 | import { UserModel } from '../user/user' | ||
41 | import { buildSQLAttributes, getSort, throwIfNotValid } from '../shared' | 40 | import { buildSQLAttributes, getSort, throwIfNotValid } from '../shared' |
41 | import { UserModel } from '../user/user' | ||
42 | import { VideoModel } from '../video/video' | 42 | import { VideoModel } from '../video/video' |
43 | import { VideoChannelModel } from '../video/video-channel' | 43 | import { VideoChannelModel } from '../video/video-channel' |
44 | import { VideoCommentModel } from '../video/video-comment' | 44 | import { VideoCommentModel } from '../video/video-comment' |
@@ -296,9 +296,7 @@ export class AccountModel extends Model<Partial<AttributesOnly<AccountModel>>> { | |||
296 | { | 296 | { |
297 | model: ActorModel, | 297 | model: ActorModel, |
298 | required: true, | 298 | required: true, |
299 | where: { | 299 | where: ActorModel.wherePreferredUsername(name) |
300 | preferredUsername: name | ||
301 | } | ||
302 | } | 300 | } |
303 | ] | 301 | ] |
304 | } | 302 | } |
@@ -321,9 +319,7 @@ export class AccountModel extends Model<Partial<AttributesOnly<AccountModel>>> { | |||
321 | { | 319 | { |
322 | model: ActorModel, | 320 | model: ActorModel, |
323 | required: true, | 321 | required: true, |
324 | where: { | 322 | where: ActorModel.wherePreferredUsername(name), |
325 | preferredUsername: name | ||
326 | }, | ||
327 | include: [ | 323 | include: [ |
328 | { | 324 | { |
329 | model: ServerModel, | 325 | model: ServerModel, |