Skip to content
Snippets Groups Projects
Commit 09d7e5af authored by Ben Adida's avatar Ben Adida
Browse files

removed confusing characters from possible password characters

parent bd99cbe0
Branches
Tags
No related merge requests found
......@@ -925,7 +925,7 @@ class Voter(HeliosModel):
if self.voter_password:
raise Exception("password already exists")
self.voter_password = heliosutils.random_string(length)
self.voter_password = heliosutils.random_string(length, alphabet='abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ23456789')
def store_vote(self, cast_vote):
# only store the vote if it's cast later than the current one
......
......@@ -119,9 +119,9 @@ def xss_strip_all_tags(s):
random.seed()
def random_string(length=20):
def random_string(length=20, alphabet=None):
random.seed()
ALPHABET = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
ALPHABET = alphabet or 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
r_string = ''
for i in range(length):
r_string += random.choice(ALPHABET)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment