Commit e90f4fe1 authored by Hinrikus Wolf's avatar Hinrikus Wolf

Merge branch 'master' of git.fsmpi.rwth-aachen.de:redl/redeleitsystem

parents c87c4925 e9d8166d
...@@ -40,7 +40,7 @@ def addadmin(): ...@@ -40,7 +40,7 @@ def addadmin():
admin_hashed_pw = pbkdf2_sha256.encrypt(admin_pass, rounds=200000, salt_size=16) admin_hashed_pw = pbkdf2_sha256.encrypt(admin_pass, rounds=200000, salt_size=16)
u = User(admin_real_name, admin_login, admin_hashed_pw, ["admin", "user"]) u = User(admin_real_name, admin_login, admin_hashed_pw, ["admin", "user"])
db.session.add(u) db.session.add(u)
db.session.commit(u) db.session.commit()
else: else:
print("The provided data was invalid.") print("The provided data was invalid.")
...@@ -55,20 +55,13 @@ def adduser(): ...@@ -55,20 +55,13 @@ def adduser():
admin_hashed_pw = pbkdf2_sha256.encrypt(admin_pass, rounds=200000, salt_size=16) admin_hashed_pw = pbkdf2_sha256.encrypt(admin_pass, rounds=200000, salt_size=16)
u = User(admin_real_name, admin_login, admin_hashed_pw, ["user"]) u = User(admin_real_name, admin_login, admin_hashed_pw, ["user"])
db.session.add(u) db.session.add(u)
db.session.commit(u) db.session.commit()
else: else:
print("The provided data was invalid.") print("The provided data was invalid.")
@app.route("/") @app.route("/")
def index(): def index():
if not len(db.session.query(User).all()) > 0: topics = Topic.query.all()
fullname = input("Fullname for admin user:")
username = input("Username for admin user:")
password = pbkdf2_sha256.encrypt(input("Password for admin user:"), rounds=200000, salt_size=16)
user = User(fullname, username, password, ["admin", "user"])
db.session.add(user)
db.session.commit()
topics = Topic.query.all()
meta = [] meta = []
for topic in topics: for topic in topics:
ls = speech.query_statements(topic.mode, topic.id) ls = speech.query_statements(topic.mode, topic.id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment