Changeset 184
- Timestamp:
- 01/18/09 22:28:01 (10 months ago)
- Files:
-
- management/bs-admin/trunk/cache_and_sync.py (modified) (1 diff)
- management/bs-admin/trunk/sync_elgg_trac.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
management/bs-admin/trunk/cache_and_sync.py
r183 r184 313 313 value = cursor.fetchall() 314 314 if value: 315 sql = "UPDATE elgg_profile_data SET value= '%s' WHERE owner='%s' AND name='biography'" % (descr, project_id)316 cursor.execute(sql )315 sql = "UPDATE elgg_profile_data SET value=%s WHERE owner=%s AND name='biography'" 316 cursor.execute(sql, (descr, project_id)) 317 317 conn.commit() 318 318 else: 319 sql = "INSERT INTO elgg_profile_data VALUES (DEFAULT, '%s', 'LOGGED_IN', 'biography', '%s')" % (project_id, descr)320 cursor.execute(sql )319 sql = "INSERT INTO elgg_profile_data VALUES (DEFAULT, %s, 'LOGGED_IN', 'biography', %s)" 320 cursor.execute(sql, (project_id, descr)) 321 321 conn.commit() 322 322 management/bs-admin/trunk/sync_elgg_trac.py
r160 r184 1 #!/usr/bin/python 1 2 import psycopg2 2 3 … … 52 53 cursor.execute(sql) 53 54 value = cursor.fetchall() 54 ownerid = value[0][0] 55 try: 56 ownerid = value[0][0] 57 except: 58 print value 59 print username 60 continue 55 61 sql = "INSERT INTO elgg_users (username, name, active, owner, user_type, moderation) VALUES ('%s', '%s', 'yes', '%s', 'project', 'no');" % (shortname, project_name, ownerid) 56 62 cursor.execute(sql)

