aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-11 16:16:27 +0200
committerChocobozzz <me@florianbigard.com>2023-05-11 16:16:27 +0200
commit85c20aaeb90ef0e0f44c377e62c323fde275cdde (patch)
tree79d09e1b6f1746398c2ea4f0279ac54fa2be96dd /server/models/account
parent823c34c07fc0df81110098ee1032e9d3ed70b662 (diff)
downloadPeerTube-85c20aaeb90ef0e0f44c377e62c323fde275cdde.tar.gz
PeerTube-85c20aaeb90ef0e0f44c377e62c323fde275cdde.tar.zst
PeerTube-85c20aaeb90ef0e0f44c377e62c323fde275cdde.zip
Set actor preferred name case insensitive
Diffstat (limited to 'server/models/account')
-rw-r--r--server/models/account/account-video-rate.ts6
-rw-r--r--server/models/account/account.ts10
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'
37import { ApplicationModel } from '../application/application' 37import { ApplicationModel } from '../application/application'
38import { ServerModel } from '../server/server' 38import { ServerModel } from '../server/server'
39import { ServerBlocklistModel } from '../server/server-blocklist' 39import { ServerBlocklistModel } from '../server/server-blocklist'
40import { UserModel } from '../user/user'
41import { buildSQLAttributes, getSort, throwIfNotValid } from '../shared' 40import { buildSQLAttributes, getSort, throwIfNotValid } from '../shared'
41import { UserModel } from '../user/user'
42import { VideoModel } from '../video/video' 42import { VideoModel } from '../video/video'
43import { VideoChannelModel } from '../video/video-channel' 43import { VideoChannelModel } from '../video/video-channel'
44import { VideoCommentModel } from '../video/video-comment' 44import { 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,