diff options
Diffstat (limited to 'server/models/account')
-rw-r--r-- | server/models/account/account-video-rate.ts | 6 | ||||
-rw-r--r-- | server/models/account/account.ts | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/server/models/account/account-video-rate.ts b/server/models/account/account-video-rate.ts index 9e7ef4394..18ff07d53 100644 --- a/server/models/account/account-video-rate.ts +++ b/server/models/account/account-video-rate.ts | |||
@@ -189,8 +189,10 @@ export class AccountVideoRateModel extends Model<Partial<AttributesOnly<AccountV | |||
189 | model: ActorModel.unscoped(), | 189 | model: ActorModel.unscoped(), |
190 | required: true, | 190 | required: true, |
191 | where: { | 191 | where: { |
192 | preferredUsername: accountName, | 192 | [Op.and]: [ |
193 | serverId: null | 193 | ActorModel.wherePreferredUsername(accountName), |
194 | { serverId: null } | ||
195 | ] | ||
194 | } | 196 | } |
195 | } | 197 | } |
196 | ] | 198 | ] |
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, |