def update_default_setting(cred_db, form_data, email): noteColor = form_data['noteColor'] fontName = form_data['fontName'] fontSize = form_data['fontSize'] draftjs = { "blocks": [{ "key": "9043t", "text": " ", "type": "unstyled", "depth": 0, "inlineStyleRanges": [{ "offset": 0, "length": 1, "style": "fontsize-" + str(fontSize) }, { "offset": 0, "length": 1, "style": "fontfamily-" + fontName }], "entityRanges": [], "data": {} }], "entityMap": {} } query = { '$set': { 'defaultNoteSettings': { 'noteColor': noteColor, 'fontName': fontName, 'fontSize': fontSize, 'draftjsObj': draftjs } } } dbcalls.DB_find_one_and_update(cred_db, {'email': email}, query)
def changeNoteColor(): noteID = ObjectId(request.args['noteID']) noteColor = request.args['noteColor'] query = {'$set': {'noteColor': noteColor}} dbcalls.DB_find_one_and_update(notes_collection, {'_id': noteID}, query) return "Note Color Changed", 200
def disable_tutorial(cred_db, email): query = {'$set': {'runTutorial': False}} dbcalls.DB_find_one_and_update(cred_db, {'email': email}, query)