Fix adminview viewport, Update secretdb on user creation
This commit is contained in:
parent
504b85b7ed
commit
9f02ffa55c
@ -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">
|
||||
|
6
model.py
6
model.py
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user