# HG changeset patch # User Marcin Kuzminski # Date 2012-02-14 21:33:08 # Node ID 4d3179d2adfee7afd100befbf47befebad3bc34a # Parent 335b55caa81d927257c7fe635dec2e15448fd432 added optional password type in password generator diff --git a/rhodecode/lib/auth.py b/rhodecode/lib/auth.py --- a/rhodecode/lib/auth.py +++ b/rhodecode/lib/auth.py @@ -80,7 +80,9 @@ class PasswordGenerator(object): def __init__(self, passwd=''): self.passwd = passwd - def gen_password(self, length, type_): + def gen_password(self, length, type_=None): + if type_ is None: + type_ = self.ALPHABETS_FULL self.passwd = ''.join([random.choice(type_) for _ in xrange(length)]) return self.passwd