diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-04-03 21:24:36 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-04-03 21:24:36 +0200 |
commit | 1d49e1e27d63db1dfc9a7fd28c9902f488831a89 (patch) | |
tree | ce3353ad691876c55ce8fcfdd70bfa2b9112b39a /server/helpers/custom-validators/users.js | |
parent | 31b59b477459d4f26ed8ef089a0e5553fb6a332b (diff) | |
download | PeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.tar.gz PeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.tar.zst PeerTube-1d49e1e27d63db1dfc9a7fd28c9902f488831a89.zip |
Server: Add NSFW in user profile
Diffstat (limited to 'server/helpers/custom-validators/users.js')
-rw-r--r-- | server/helpers/custom-validators/users.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/users.js b/server/helpers/custom-validators/users.js index 88fa1592e..2fc026e98 100644 --- a/server/helpers/custom-validators/users.js +++ b/server/helpers/custom-validators/users.js | |||
@@ -9,7 +9,8 @@ const USERS_CONSTRAINTS_FIELDS = constants.CONSTRAINTS_FIELDS.USERS | |||
9 | const usersValidators = { | 9 | const usersValidators = { |
10 | isUserPasswordValid, | 10 | isUserPasswordValid, |
11 | isUserRoleValid, | 11 | isUserRoleValid, |
12 | isUserUsernameValid | 12 | isUserUsernameValid, |
13 | isUserDisplayNSFWValid | ||
13 | } | 14 | } |
14 | 15 | ||
15 | function isUserPasswordValid (value) { | 16 | function isUserPasswordValid (value) { |
@@ -26,6 +27,10 @@ function isUserUsernameValid (value) { | |||
26 | return validator.matches(value, new RegExp(`^[a-zA-Z0-9._]{${min},${max}}$`)) | 27 | return validator.matches(value, new RegExp(`^[a-zA-Z0-9._]{${min},${max}}$`)) |
27 | } | 28 | } |
28 | 29 | ||
30 | function isUserDisplayNSFWValid (value) { | ||
31 | return validator.isBoolean(value) | ||
32 | } | ||
33 | |||
29 | // --------------------------------------------------------------------------- | 34 | // --------------------------------------------------------------------------- |
30 | 35 | ||
31 | module.exports = usersValidators | 36 | module.exports = usersValidators |