Skip to content
Snippets Groups Projects
Commit ce2dfb56 authored by Julian Rother's avatar Julian Rother
Browse files

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.
parent 4ccaebfc
Branches
No related tags found
No related merge requests found
...@@ -279,7 +279,8 @@ def edit(prefix="", ignore=[]): ...@@ -279,7 +279,8 @@ def edit(prefix="", ignore=[]):
table, id, column = key.split('.', 2) table, id, column = key.split('.', 2)
assert table in tabs assert table in tabs
assert column in tabs[table][2] 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('UPDATE %s SET %s = ?, time_updated = ? WHERE %s = ?'%(tabs[table][0], column, tabs[table][1]), val, datetime.now(), id)
modify('COMMIT') modify('COMMIT')
if 'ref' in request.values: if 'ref' in request.values:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment