brotherton-erpnext/patches/july_2012/auth_table.py

15 lines
424 B
Python
Raw Normal View History

from __future__ import unicode_literals
2012-07-13 09:37:07 +00:00
import webnotes
def execute():
webnotes.conn.commit()
from webnotes.install_lib.install import Installer
Installer(None, None).create_auth_table()
webnotes.conn.begin()
for user, password in webnotes.conn.sql("""select name, password from tabProfile"""):
if password:
webnotes.conn.sql("""insert into __Auth (user, `password`) values (%s, %s)""",
(user, password))