changeset 1993:4d3179d2adfe beta

added optional password type in password generator
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 14 Feb 2012 23:33:08 +0200
parents 335b55caa81d
children b6c902d88472
files rhodecode/lib/auth.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/auth.py	Tue Feb 14 23:30:40 2012 +0200
+++ b/rhodecode/lib/auth.py	Tue Feb 14 23:33:08 2012 +0200
@@ -80,7 +80,9 @@
     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