From b385ac7ed33a517f72d881d2919a10b9ff9069b7 Mon Sep 17 00:00:00 2001 From: anmol Date: Wed, 4 Nov 2020 19:53:06 +0530 Subject: [PATCH 1/2] Trim username while new user creation to eliminate unecessary error --- src/js/yunohost/controllers/users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/yunohost/controllers/users.js b/src/js/yunohost/controllers/users.js index 03c9425d..21008bbf 100644 --- a/src/js/yunohost/controllers/users.js +++ b/src/js/yunohost/controllers/users.js @@ -207,7 +207,7 @@ } c.params['domain'] = c.params['domain'].slice(1); - + c.params['username']=c.params['username'].trim(); c.api('POST', '/users', c.params.toHash(), function(data) { c.redirect_to('#/users'); }); From d53e400e3ddbd7491b3b8c2425c21fbbff9a4575 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 4 Nov 2020 15:47:20 +0100 Subject: [PATCH 2/2] Formating --- src/js/yunohost/controllers/users.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/yunohost/controllers/users.js b/src/js/yunohost/controllers/users.js index 21008bbf..58ecad4a 100644 --- a/src/js/yunohost/controllers/users.js +++ b/src/js/yunohost/controllers/users.js @@ -207,7 +207,8 @@ } c.params['domain'] = c.params['domain'].slice(1); - c.params['username']=c.params['username'].trim(); + c.params['username'] = c.params['username'].trim(); + c.api('POST', '/users', c.params.toHash(), function(data) { c.redirect_to('#/users'); });