From 7aefe4bd17a0cd729d5aecc8cc397bac5344f631 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 31 Aug 2012 21:18:53 +0200 Subject: [PATCH] Update of the OpenID was not working (it was only working at creation of the user) and missing for the user itself. --- main.py | 8 ++++---- templates/user_edit.html | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index b460113..4bbd46c 100755 --- a/main.py +++ b/main.py @@ -200,8 +200,8 @@ def user_edit(userid): if request.method == 'POST': if query_db('select * from users where email=? and id!=?', [request.form['email'], userid], one=True) is None: if query_db('select * from users where name=? and id!=?', [request.form['name'], userid], one=True) is None: - g.db.execute('update users set email = ?, name = ?, organization = ? where id = ?', - [request.form['email'], request.form['name'], request.form['organization'], session['user']['id']]) + g.db.execute('update users set email = ?, openid = ?, name = ?, organization = ? where id = ?', + [request.form['email'], request.form['openid'], request.form['name'], request.form['organization'], session['user']['id']]) g.db.commit() disconnect_user() user = query_db('select * from users where id=?', [userid], one=True) @@ -334,8 +334,8 @@ def admin_user_edit(iduser): admin = 0 if 'admin' in request.form.keys(): admin = 1 - g.db.execute('update users set email = ?, name = ?, organization = ?, is_admin = ? where id = ?', - [request.form['email'], request.form['name'], request.form['organization'], admin, iduser]) + g.db.execute('update users set email = ?, name = ?, organization = ?, openid= ?, is_admin = ? where id = ?', + [request.form['email'], request.form['name'], request.form['organization'], request.form['openid'], admin, iduser]) g.db.commit() groups = request.form.getlist('groups') groups.append('1') diff --git a/templates/user_edit.html b/templates/user_edit.html index 7c0d337..4c8b3b8 100644 --- a/templates/user_edit.html +++ b/templates/user_edit.html @@ -23,6 +23,12 @@ +
+ +
+ +
+
-- 2.20.1