Archived
PEP8
This commit is contained in:
1 parent
3cf06df258
commit
6b0d5df885
1 file changed
+6
-4
@@ -3,6 +3,7 @@ from flask.json import JSONEncoder
|
||||
import string
|
||||
import random
|
||||
|
||||
|
||||
class CustomJSONEncoder(JSONEncoder):
|
||||
def default(self, obj):
|
||||
try:
|
||||
@@ -15,8 +16,9 @@ class CustomJSONEncoder(JSONEncoder):
|
||||
return list(iterable)
|
||||
return JSONEncoder.default(self, obj)
|
||||
|
||||
|
||||
def generate_activation_code(length=5):
|
||||
chars = string.ascii_lowercase + string.digits
|
||||
# remove easily misintepreted chars
|
||||
chars = chars.translate(None,'0oil1wv')
|
||||
return ''.join(random.choice(chars) for _ in range(length))
|
||||
chars = string.ascii_lowercase + string.digits
|
||||
# remove easily misinterpreted chars
|
||||
chars = chars.translate(None, '0oil1wv')
|
||||
return ''.join(random.choice(chars) for _ in range(length))
|
||||
Reference in new issue
Block a user