mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-19 21:25:30 +00:00
Merge branch 'master' into Develop
This commit is contained in:
commit
3ff3431b17
@ -466,6 +466,9 @@ def reset_password(user_id):
|
|||||||
def generate_random_password():
|
def generate_random_password():
|
||||||
s = "abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%&*()?"
|
s = "abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%&*()?"
|
||||||
passlen = 8
|
passlen = 8
|
||||||
|
if sys.version_info < (3, 0):
|
||||||
|
return "".join(s[ord(c) % len(s)] for c in os.urandom(passlen))
|
||||||
|
else:
|
||||||
return "".join(s[c % len(s)] for c in os.urandom(passlen))
|
return "".join(s[c % len(s)] for c in os.urandom(passlen))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user