updated user generation

master
James Sigurðarson 2016-07-12 21:26:06 +00:00
parent 9700d156e7
commit 09bfb88ff9
1 changed files with 11 additions and 1 deletions

12
ctftool
View File

@ -42,10 +42,20 @@ def gen_team(args):
diff = timedelta(minutes=5) diff = timedelta(minutes=5)
for i in range(n): for i in range(n):
name = "Team {}".format(i + 1) name = "Team {}".format(i + 1)
t = Team.create(name=name, email="none@none.com", affiliation="Autogenerated", eligible=True, key="", email_confirmation_key="autogen", email_confirmed=True) t = Team.create(name=name, affiliation="Autogenerated", key="")
t.key = "autogen{}".format(t.id) t.key = "autogen{}".format(t.id)
username = "username{}".format(i+1)
password = "password{}".format(i+1)
user = User.create(username=username, email="nope@nope.nope",
background="university", country="ISL",
tshirt_size="XL", gender="M",
email_confirmation_key="autogen", email_confirmed=True,
team=team)
t.save() t.save()
user.setPassword("password{}".format(user.id))
user.save()
print("Team added with id {}".format(t.id)) print("Team added with id {}".format(t.id))
print("User added with username {} and password {}".format(username, password))
def add_admin(args): def add_admin(args):
username = input("Username: ") username = input("Username: ")