From ce2dfb564c6fef20e2233e93f4240a8c33948ab7 Mon Sep 17 00:00:00 2001 From: Julian Rother <julianr@fsmpi.rwth-aachen.de> Date: Sat, 10 Sep 2016 13:08:39 +0200 Subject: [PATCH] Corrected INSERT statement for changelog The who field is the user id not the name! I did this the right way when I implemented this. Please be more careful, when you deal with merge conflicts. --- server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 6c458ea..3c4c19d 100755 --- a/server.py +++ b/server.py @@ -279,7 +279,8 @@ def edit(prefix="", ignore=[]): table, id, column = key.split('.', 2) assert table in tabs assert column in tabs[table][2] - modify('INSERT INTO changelog ("table",id_value,id_key,field,value_new,value_old,"when",who,executed) VALUES (?,?,?,?,?,(SELECT %s FROM %s WHERE %s = ?),?,?,1)'%(column,tabs[table][0],tabs[table][1]),table,id,tabs[table][1],column,val,id,datetime.now(),session['user']['givenName']) + modify('INSERT INTO changelog (`table`,id_value, id_key, field, value_new, value_old, `when`, who, executed) VALUES (?,?,?,?,?,(SELECT %s FROM %s WHERE %s = ?),?,?,1)'%(column, tabs[table][0], tabs[table][1]), + table, id, tabs[table][1], column, val, id, datetime.now(), session['user']['dbid']) modify('UPDATE %s SET %s = ?, time_updated = ? WHERE %s = ?'%(tabs[table][0], column, tabs[table][1]), val, datetime.now(), id) modify('COMMIT') if 'ref' in request.values: -- GitLab