[master/f21-branch][PATCH] Strip suggested usernames to 8 characters

Vratislav Podzimek vpodzime at redhat.com
Wed Sep 10 17:55:47 UTC 2014


On Tue, 2014-08-26 at 10:40 +0200, Vratislav Podzimek wrote:
> This is a practical and widely used pattern.
> 
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
>  pyanaconda/users.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/pyanaconda/users.py b/pyanaconda/users.py
> index 82cd2d3..f25c8fa 100644
> --- a/pyanaconda/users.py
> +++ b/pyanaconda/users.py
> @@ -192,8 +192,9 @@ def guess_username(fullname):
>      if len(fullname) > 1:
>          username = fullname[0].decode("utf-8")[0].lower() + username
>  
> +    # strip accents and make the username at most 8 characters long
>      username = strip_accents(username).encode("utf-8")
> -    return username
> +    return username[0:8]
>  
>  class Users:
>      def __init__ (self):
Anybody against this change on master?

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list