diff options
author | BRAINS YUM <43896676+McFlat@users.noreply.github.com> | 2018-12-07 07:54:33 -0600 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-12-07 14:54:33 +0100 |
commit | d0ce42c1c17054b7e0c5081243152c32ecb1c193 (patch) | |
tree | b68c434203b2cd43f8b739e9d540b174faebb27e /server/initializers | |
parent | f3e4d594080e2ae727da07e9d3febf5b6ce5cb75 (diff) | |
download | PeerTube-d0ce42c1c17054b7e0c5081243152c32ecb1c193.tar.gz PeerTube-d0ce42c1c17054b7e0c5081243152c32ecb1c193.tar.zst PeerTube-d0ce42c1c17054b7e0c5081243152c32ecb1c193.zip |
username/display_name/video_channel_name min length 1 and max length 50 (#1265)
* make username, display_name and video_channel_name min length 1 and max length 50; (fixes #1263);
! still some bug on the frontend complains but if you remove the disabled property it creates the account just fine;
allow for usernames to start with a number;
fix test, since username can be 1 char now make test check empty;
fix test, Should fail with a too long username;
fix test, Should fail with a too small username;
fix regular expression for username and videoChannel;
change username, videoChannel to be lowercase and fix message;
* change 1 characters to 1 character
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/constants.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 6b798875c..d4496bc34 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -300,9 +300,9 @@ const CONFIG = { | |||
300 | 300 | ||
301 | const CONSTRAINTS_FIELDS = { | 301 | const CONSTRAINTS_FIELDS = { |
302 | USERS: { | 302 | USERS: { |
303 | NAME: { min: 3, max: 120 }, // Length | 303 | NAME: { min: 1, max: 50 }, // Length |
304 | DESCRIPTION: { min: 3, max: 1000 }, // Length | 304 | DESCRIPTION: { min: 3, max: 1000 }, // Length |
305 | USERNAME: { min: 3, max: 20 }, // Length | 305 | USERNAME: { min: 1, max: 50 }, // Length |
306 | PASSWORD: { min: 6, max: 255 }, // Length | 306 | PASSWORD: { min: 6, max: 255 }, // Length |
307 | VIDEO_QUOTA: { min: -1 }, | 307 | VIDEO_QUOTA: { min: -1 }, |
308 | VIDEO_QUOTA_DAILY: { min: -1 }, | 308 | VIDEO_QUOTA_DAILY: { min: -1 }, |
@@ -316,7 +316,7 @@ const CONSTRAINTS_FIELDS = { | |||
316 | REASON: { min: 2, max: 300 } // Length | 316 | REASON: { min: 2, max: 300 } // Length |
317 | }, | 317 | }, |
318 | VIDEO_CHANNELS: { | 318 | VIDEO_CHANNELS: { |
319 | NAME: { min: 3, max: 120 }, // Length | 319 | NAME: { min: 1, max: 50 }, // Length |
320 | DESCRIPTION: { min: 3, max: 1000 }, // Length | 320 | DESCRIPTION: { min: 3, max: 1000 }, // Length |
321 | SUPPORT: { min: 3, max: 1000 }, // Length | 321 | SUPPORT: { min: 3, max: 1000 }, // Length |
322 | URL: { min: 3, max: 2000 } // Length | 322 | URL: { min: 3, max: 2000 } // Length |