aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/account')
-rw-r--r--server/models/account/user.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index ea6d63312..81b0651fd 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -21,6 +21,7 @@ import { hasUserRight, USER_ROLE_LABELS, UserRight } from '../../../shared'
21import { User, UserRole } from '../../../shared/models/users' 21import { User, UserRole } from '../../../shared/models/users'
22import { 22import {
23 isUserAutoPlayVideoValid, 23 isUserAutoPlayVideoValid,
24 isUserBlockedReasonValid,
24 isUserBlockedValid, 25 isUserBlockedValid,
25 isUserNSFWPolicyValid, 26 isUserNSFWPolicyValid,
26 isUserPasswordValid, 27 isUserPasswordValid,
@@ -107,6 +108,12 @@ export class UserModel extends Model<UserModel> {
107 @Column 108 @Column
108 blocked: boolean 109 blocked: boolean
109 110
111 @AllowNull(true)
112 @Default(null)
113 @Is('UserBlockedReason', value => throwIfNotValid(value, isUserBlockedReasonValid, 'blocked reason'))
114 @Column
115 blockedReason: string
116
110 @AllowNull(false) 117 @AllowNull(false)
111 @Is('UserRole', value => throwIfNotValid(value, isUserRoleValid, 'role')) 118 @Is('UserRole', value => throwIfNotValid(value, isUserRoleValid, 'role'))
112 @Column 119 @Column
@@ -284,6 +291,8 @@ export class UserModel extends Model<UserModel> {
284 roleLabel: USER_ROLE_LABELS[ this.role ], 291 roleLabel: USER_ROLE_LABELS[ this.role ],
285 videoQuota: this.videoQuota, 292 videoQuota: this.videoQuota,
286 createdAt: this.createdAt, 293 createdAt: this.createdAt,
294 blocked: this.blocked,
295 blockedReason: this.blockedReason,
287 account: this.Account.toFormattedJSON(), 296 account: this.Account.toFormattedJSON(),
288 videoChannels: [] 297 videoChannels: []
289 } 298 }