aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
authorFelix Ableitner <me@nutomic.com>2018-08-28 02:01:35 -0500
committerChocobozzz <me@florianbigard.com>2018-08-28 09:01:35 +0200
commitbee0abffff73804d816b90c7fd599e0a51c09d61 (patch)
treefae6d58637f9c63a3800090277f8e130b43442dd /server/helpers
parentc907c2fa3fd7c0a741117a0204d0ebca675124bd (diff)
downloadPeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.tar.gz
PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.tar.zst
PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.zip
Implement daily upload limit (#956)
* Implement daily upload limit (ref #652) * remove duplicate code * review fixes * fix tests? * whitespace fixes, finish leftover todo * fix tests * added some new tests * use different config value for tests * remove todo
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/custom-validators/users.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/users.ts b/server/helpers/custom-validators/users.ts
index c3cdefd4e..8d6247e41 100644
--- a/server/helpers/custom-validators/users.ts
+++ b/server/helpers/custom-validators/users.ts
@@ -15,6 +15,10 @@ function isUserVideoQuotaValid (value: string) {
15 return exists(value) && validator.isInt(value + '', USERS_CONSTRAINTS_FIELDS.VIDEO_QUOTA) 15 return exists(value) && validator.isInt(value + '', USERS_CONSTRAINTS_FIELDS.VIDEO_QUOTA)
16} 16}
17 17
18function isUserVideoQuotaDailyValid (value: string) {
19 return exists(value) && validator.isInt(value + '', USERS_CONSTRAINTS_FIELDS.VIDEO_QUOTA_DAILY)
20}
21
18function isUserUsernameValid (value: string) { 22function isUserUsernameValid (value: string) {
19 const max = USERS_CONSTRAINTS_FIELDS.USERNAME.max 23 const max = USERS_CONSTRAINTS_FIELDS.USERNAME.max
20 const min = USERS_CONSTRAINTS_FIELDS.USERNAME.min 24 const min = USERS_CONSTRAINTS_FIELDS.USERNAME.min
@@ -66,6 +70,7 @@ export {
66 isUserBlockedReasonValid, 70 isUserBlockedReasonValid,
67 isUserRoleValid, 71 isUserRoleValid,
68 isUserVideoQuotaValid, 72 isUserVideoQuotaValid,
73 isUserVideoQuotaDailyValid,
69 isUserUsernameValid, 74 isUserUsernameValid,
70 isUserNSFWPolicyValid, 75 isUserNSFWPolicyValid,
71 isUserAutoPlayVideoValid, 76 isUserAutoPlayVideoValid,