Merge pull request #519 from singuliere/wip-create-user

randomly generated passwords must obey some constraints
This commit is contained in:
neonmei 2020-12-11 10:50:25 -03:00 committed by GitHub
commit a97673c6b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,13 +69,20 @@ if __name__ == "__main__":
# set a random password for all other users
for name, id in initial_users.items():
if name != username:
specials = "@$!%*?&-_"
random_pass = "".join(
[
random.choice(string.ascii_uppercase),
random.choice(string.ascii_lowercase),
random.choice(string.digits),
random.choice(specials),
] +
random.choices(
string.ascii_uppercase
+ string.ascii_lowercase
+ string.digits
+ "@$!%*?&-_",
k=16,
+ specials,
k=14,
)
)
update_user(