Added functions to get and set dark theme for users
This commit is contained in:
parent
0e7bbb442b
commit
417da1a9d2
1 changed files with 10 additions and 0 deletions
|
@ -5,6 +5,16 @@ client = MongoClient()
|
|||
accounts_db = client.tweeder.accounts
|
||||
|
||||
|
||||
def get_dark_theme(username):
|
||||
username = username.lower()
|
||||
return accounts_db.find_one({"username": username})['darktheme']
|
||||
|
||||
|
||||
def set_dark_theme(username, value):
|
||||
username = username.lower()
|
||||
accounts_db.update_one({'username': username}, {"$set": {"darktheme": value}})
|
||||
|
||||
|
||||
def get_display_name(username):
|
||||
return accounts_db.find_one({'username': username})['displayname']
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue