mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-13 16:29:49 -06:00
recording note content and title changes to audit_log
This commit is contained in:
@@ -46,6 +46,14 @@ def addAudit(category, request = None, note_id = None, change_from = None, chang
|
||||
execute("INSERT INTO audit_log (date_modified, category, browser_id, note_id, change_from, change_to, comment)"
|
||||
" VALUES (?, ?, ?, ?, ?, ?, ?)", [now, category, browser_id, note_id, change_from, change_to, comment])
|
||||
|
||||
def deleteRecentAudits(category, request, note_id):
|
||||
browser_id = request.headers['x-browser-id']
|
||||
|
||||
delete_cutoff = math.floor(time.time()) - 10 * 60;
|
||||
|
||||
execute("DELETE FROM audit_log WHERE category = ? AND browser_id = ? AND note_id = ? AND date_modified > ?",
|
||||
[category, browser_id, note_id, delete_cutoff])
|
||||
|
||||
def delete(tablename, note_id):
|
||||
execute("DELETE FROM " + tablename + " WHERE note_id = ?", [note_id])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user