X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fuser%2Fuser.ts;h=ddce455a1dda464bd9a17a51c401e7b46da8027d;hb=8f581725651c4b2c213d75fc028e306bbf239d3e;hp=20696b1f49fb04d0ed8e9f1ae1186c91d6ff6272;hpb=819b656439e5f0ec2ae5de9357502cdfe3196197;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/user/user.ts b/server/models/user/user.ts index 20696b1f4..ddce455a1 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts @@ -39,8 +39,6 @@ import { UserAdminFlag } from '../../../shared/models/users/user-flag.model' import { NSFWPolicyType } from '../../../shared/models/videos/nsfw-policy.type' import { isThemeNameValid } from '../../helpers/custom-validators/plugins' import { - isNoInstanceConfigWarningModal, - isNoWelcomeModal, isUserAdminFlagsValid, isUserAutoPlayNextVideoPlaylistValid, isUserAutoPlayNextVideoValid, @@ -48,6 +46,7 @@ import { isUserBlockedReasonValid, isUserBlockedValid, isUserEmailVerifiedValid, + isUserNoModal, isUserNSFWPolicyValid, isUserPasswordValid, isUserRoleValid, @@ -349,7 +348,7 @@ export class UserModel extends Model>> { @Default(false) @Is( 'UserNoInstanceConfigWarningModal', - value => throwIfNotValid(value, isNoInstanceConfigWarningModal, 'no instance config warning modal') + value => throwIfNotValid(value, isUserNoModal, 'no instance config warning modal') ) @Column noInstanceConfigWarningModal: boolean @@ -357,12 +356,21 @@ export class UserModel extends Model>> { @AllowNull(false) @Default(false) @Is( - 'UserNoInstanceConfigWarningModal', - value => throwIfNotValid(value, isNoWelcomeModal, 'no welcome modal') + 'UserNoWelcomeModal', + value => throwIfNotValid(value, isUserNoModal, 'no welcome modal') ) @Column noWelcomeModal: boolean + @AllowNull(false) + @Default(false) + @Is( + 'UserNoAccountSetupWarningModal', + value => throwIfNotValid(value, isUserNoModal, 'no account setup warning modal') + ) + @Column + noAccountSetupWarningModal: boolean + @AllowNull(true) @Default(null) @Column @@ -920,6 +928,7 @@ export class UserModel extends Model>> { noInstanceConfigWarningModal: this.noInstanceConfigWarningModal, noWelcomeModal: this.noWelcomeModal, + noAccountSetupWarningModal: this.noAccountSetupWarningModal, blocked: this.blocked, blockedReason: this.blockedReason, @@ -958,7 +967,7 @@ export class UserModel extends Model>> { } toMeFormattedJSON (this: MMyUserFormattable): MyUser { - const formatted = this.toFormattedJSON() + const formatted = this.toFormattedJSON({ withAdminFlags: true }) const specialPlaylists = this.Account.VideoPlaylists .map(p => ({ id: p.id, name: p.name, type: p.type }))