Fix adminview viewport, Update secretdb on user creation

This commit is contained in:
Dominic Zimmer 2020-07-18 11:17:24 +02:00
parent 504b85b7ed
commit 9f02ffa55c
2 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,7 @@
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>Waschmarken.io</title>
<meta name="description" content="Waschmarken Scoreboard">

View File

@ -38,13 +38,14 @@ class Model(object):
# newuser = User()
# self.users[newuser.uuid] = newuser
self.secretlookup = { self.users[uuid].get_secret() : uuid for uuid in self.users }
self.update_secretdb()
print(f'Admin Token: {hashlib.sha256(SECRET.encode() + b"admintoken").hexdigest()}')
#for user in self.users.values():
# print(f"{user.name.rjust(25)} -> /dealer/{user.get_secret()}")
def update_secretdb(self):
self.secretlookup = { self.users[uuid].get_secret() : uuid for uuid in self.users }
def to_json(self):
model = {
@ -114,6 +115,7 @@ class Model(object):
raise Exception("Username can't be blank!")
newuser = User(username = username)
self.users[newuser.uuid] = newuser
self.update_secretdb()
@ApiMethod
async def rename_user(self, authtoken, uuid, newusername):