aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorWicklow <123956049+wickloww@users.noreply.github.com>2023-04-07 08:09:54 +0000
committerGitHub <noreply@github.com>2023-04-07 10:09:54 +0200
commitb302c80dc0d9ba8eabef9ef6576efe36afc57584 (patch)
tree14d406b41291805deb94a36a5e79f8d6989355f8 /server/middlewares/validators
parent9258e9a4a37911fc64b5faada2a7e604bd1ede1f (diff)
downloadPeerTube-b302c80dc0d9ba8eabef9ef6576efe36afc57584.tar.gz
PeerTube-b302c80dc0d9ba8eabef9ef6576efe36afc57584.tar.zst
PeerTube-b302c80dc0d9ba8eabef9ef6576efe36afc57584.zip
feature/ability to disable video history by default (#5728)
* draft: ability to disable video history by default * Update configuration and add tests * Updated code based on review comments * Add tests on registration and video quota * Remove required video quotas in query * Fix tests
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/config.ts1
-rw-r--r--server/middlewares/validators/users.ts3
2 files changed, 4 insertions, 0 deletions
diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts
index c2dbfadb7..4a9d1cb54 100644
--- a/server/middlewares/validators/config.ts
+++ b/server/middlewares/validators/config.ts
@@ -35,6 +35,7 @@ const customConfigUpdateValidator = [
35 body('admin.email').isEmail(), 35 body('admin.email').isEmail(),
36 body('contactForm.enabled').isBoolean(), 36 body('contactForm.enabled').isBoolean(),
37 37
38 body('user.history.videos.enabled').isBoolean(),
38 body('user.videoQuota').custom(isUserVideoQuotaValid), 39 body('user.videoQuota').custom(isUserVideoQuotaValid),
39 body('user.videoQuotaDaily').custom(isUserVideoQuotaDailyValid), 40 body('user.videoQuotaDaily').custom(isUserVideoQuotaDailyValid),
40 41
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts
index f7033f44a..7ebea048d 100644
--- a/server/middlewares/validators/users.ts
+++ b/server/middlewares/validators/users.ts
@@ -65,8 +65,11 @@ const usersAddValidator = [
65 .custom(isVideoChannelUsernameValid), 65 .custom(isVideoChannelUsernameValid),
66 66
67 body('videoQuota') 67 body('videoQuota')
68 .optional()
68 .custom(isUserVideoQuotaValid), 69 .custom(isUserVideoQuotaValid),
70
69 body('videoQuotaDaily') 71 body('videoQuotaDaily')
72 .optional()
70 .custom(isUserVideoQuotaDailyValid), 73 .custom(isUserVideoQuotaDailyValid),
71 74
72 body('role') 75 body('role')