diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-06-07 14:57:04 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-06-07 14:57:04 -0700 |
commit | 123cc92cadb57e3a9e536e08a66ea54adab660ad (patch) | |
tree | ca16f2fc68e6445d137fa65f2f052f894845edbd /rust/src | |
parent | 4a1d57b9ac11445ae3d6ce9fbadbd0feaf19be86 (diff) | |
download | fatcat-123cc92cadb57e3a9e536e08a66ea54adab660ad.tar.gz fatcat-123cc92cadb57e3a9e536e08a66ea54adab660ad.zip |
allow somewhat longer usernames
Diffstat (limited to 'rust/src')
-rw-r--r-- | rust/src/identifiers.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rust/src/identifiers.rs b/rust/src/identifiers.rs index 597af338..e3e34200 100644 --- a/rust/src/identifiers.rs +++ b/rust/src/identifiers.rs @@ -70,7 +70,7 @@ pub fn uuid2fcid(id: &Uuid) -> String { pub fn check_username(raw: &str) -> Result<()> { lazy_static! { - static ref RE: Regex = Regex::new(r"^[A-Za-z][A-Za-z0-9._-]{2,24}$").unwrap(); + static ref RE: Regex = Regex::new(r"^[A-Za-z][A-Za-z0-9._-]{2,32}$").unwrap(); } if raw.is_ascii() && RE.is_match(raw) { Ok(()) @@ -92,6 +92,8 @@ fn test_check_username() { assert!(check_username("g_____").is_ok()); assert!(check_username("bnewbold2-archive").is_ok()); assert!(check_username("bnewbold2-internetarchive").is_ok()); + assert!(check_username("bnewboldtestperiods-archive").is_ok()); + assert!(check_username("DisabledCommunity.Org-archive").is_ok()); assert!(check_username("").is_err()); assert!(check_username("_").is_err()); |