diff --git a/services/web/project/__init__.py b/services/web/project/__init__.py index ae821be..997f5a2 100644 --- a/services/web/project/__init__.py +++ b/services/web/project/__init__.py @@ -234,12 +234,18 @@ def start_register(): # # mydb.commit() +# query = "INSERT INTO users (username, password) VALUES (?, ?)" +# values = ("john", "password123") +# cursor.execute(query, values) +# conn.commit() + INSERT_MEMBERS = "INSERT INTO members_pending(email,firstname,lastname) VALUES('"+firstname+"','"+lastname+"','"+email+"')" with connection: with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor: cursor.execute(INSERT_MEMBERS) - + connection.commit() last_row_id=cursor.lastrowid + print('After Insert ::: ') print(last_row_id) send_register_mail(email) @@ -382,6 +388,7 @@ def recent_actions(current_user): # FIND_USER_DETAIL= "SELECT id,uid,username,updated,email,account_name, firstname, lastname FROM members WHERE uid::text = '"+user_uid+"'" # RECENT_ACTIONS = "SELECT * FROM members_actions WHERE member_id = " + user_id + " ORDER by id DESC LIMIT 4" # RECENT_ACTIONS = "SELECT * FROM members_actions WHERE member_id::text = %s ORDER by id DESC LIMIT 4" + print((user_id) RECENT_ACTIONS = "SELECT * FROM members_actions WHERE member_id = 1 ORDER by id DESC LIMIT 4" actionVal = (user_id) with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor: