add config option to disable registration
add command to create user
This commit is contained in:
parent
17eabddd70
commit
b8531a0347
10 changed files with 131 additions and 45 deletions
|
@ -2,6 +2,8 @@ import re
|
|||
import os
|
||||
import hashlib
|
||||
import json
|
||||
import string
|
||||
import random
|
||||
|
||||
|
||||
class AttrDict(dict):
|
||||
|
@ -10,6 +12,10 @@ class AttrDict(dict):
|
|||
self.__dict__ = self
|
||||
|
||||
|
||||
def random_string(size=6, chars=string.ascii_lowercase + string.ascii_uppercase + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
|
||||
def to_json(data):
|
||||
return json.dumps(to_dict(data), separators=(',', ':'))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue