diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-23 10:40:39 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 3e753302d8c911b59971c16a8018df0e1ab78465 (patch) | |
tree | efce7ece3273589228c5c948ea6757b2bdf65429 /server/middlewares/validators/users.ts | |
parent | a8b666e9f1ed002230869606308749614390c82f (diff) | |
download | PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.tar.gz PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.tar.zst PeerTube-3e753302d8c911b59971c16a8018df0e1ab78465.zip |
Refactor middleware helpers
Diffstat (limited to 'server/middlewares/validators/users.ts')
-rw-r--r-- | server/middlewares/validators/users.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index a507afc5b..7002de20d 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts | |||
@@ -13,12 +13,12 @@ import { | |||
13 | isUserNSFWPolicyValid, | 13 | isUserNSFWPolicyValid, |
14 | isUserPasswordValid, | 14 | isUserPasswordValid, |
15 | isUserRoleValid, | 15 | isUserRoleValid, |
16 | isUserUsernameValid, isUserVideoLanguages, | 16 | isUserUsernameValid, |
17 | isUserVideoLanguages, | ||
17 | isUserVideoQuotaDailyValid, | 18 | isUserVideoQuotaDailyValid, |
18 | isUserVideoQuotaValid, | 19 | isUserVideoQuotaValid, |
19 | isUserVideosHistoryEnabledValid | 20 | isUserVideosHistoryEnabledValid |
20 | } from '../../helpers/custom-validators/users' | 21 | } from '../../helpers/custom-validators/users' |
21 | import { doesVideoExist } from '../../helpers/custom-validators/videos' | ||
22 | import { logger } from '../../helpers/logger' | 22 | import { logger } from '../../helpers/logger' |
23 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' | 23 | import { isSignupAllowed, isSignupAllowedForCurrentIP } from '../../helpers/signup' |
24 | import { Redis } from '../../lib/redis' | 24 | import { Redis } from '../../lib/redis' |
@@ -30,6 +30,7 @@ import { isVideoChannelNameValid } from '../../helpers/custom-validators/video-c | |||
30 | import { UserRegister } from '../../../shared/models/users/user-register.model' | 30 | import { UserRegister } from '../../../shared/models/users/user-register.model' |
31 | import { isThemeNameValid } from '../../helpers/custom-validators/plugins' | 31 | import { isThemeNameValid } from '../../helpers/custom-validators/plugins' |
32 | import { isThemeRegistered } from '../../lib/plugins/theme-utils' | 32 | import { isThemeRegistered } from '../../lib/plugins/theme-utils' |
33 | import { doesVideoExist } from '../../helpers/middlewares' | ||
33 | 34 | ||
34 | const usersAddValidator = [ | 35 | const usersAddValidator = [ |
35 | body('username').custom(isUserUsernameValid).withMessage('Should have a valid username (lowercase alphanumeric characters)'), | 36 | body('username').custom(isUserUsernameValid).withMessage('Should have a valid username (lowercase alphanumeric characters)'), |