diff options
author | Chocobozzz <me@florianbigard.com> | 2021-12-15 15:58:10 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-12-16 10:08:55 +0100 |
commit | a9bfa85d2cdf13670aaced740da5b493fbeddfce (patch) | |
tree | 3781c9218d4cc7786b6589365c0efbed2151703d /server/middlewares/validators/users.ts | |
parent | c77fdc605b3ccc1ab6890f889d8200fbe9372949 (diff) | |
download | PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.tar.gz PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.tar.zst PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.zip |
Add ability for admins to set default p2p policy
Diffstat (limited to 'server/middlewares/validators/users.ts')
-rw-r--r-- | server/middlewares/validators/users.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index 7a6b2ce57..bc6007c6d 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts | |||
@@ -15,6 +15,7 @@ import { | |||
15 | isUserDisplayNameValid, | 15 | isUserDisplayNameValid, |
16 | isUserNoModal, | 16 | isUserNoModal, |
17 | isUserNSFWPolicyValid, | 17 | isUserNSFWPolicyValid, |
18 | isUserP2PEnabledValid, | ||
18 | isUserPasswordValid, | 19 | isUserPasswordValid, |
19 | isUserPasswordValidOrEmpty, | 20 | isUserPasswordValidOrEmpty, |
20 | isUserRoleValid, | 21 | isUserRoleValid, |
@@ -239,6 +240,9 @@ const usersUpdateMeValidator = [ | |||
239 | body('autoPlayVideo') | 240 | body('autoPlayVideo') |
240 | .optional() | 241 | .optional() |
241 | .custom(isUserAutoPlayVideoValid).withMessage('Should have a valid automatically plays video attribute'), | 242 | .custom(isUserAutoPlayVideoValid).withMessage('Should have a valid automatically plays video attribute'), |
243 | body('p2pEnabled') | ||
244 | .optional() | ||
245 | .custom(isUserP2PEnabledValid).withMessage('Should have a valid p2p enabled boolean'), | ||
242 | body('videoLanguages') | 246 | body('videoLanguages') |
243 | .optional() | 247 | .optional() |
244 | .custom(isUserVideoLanguages).withMessage('Should have a valid video languages attribute'), | 248 | .custom(isUserVideoLanguages).withMessage('Should have a valid video languages attribute'), |