@click.command(u'add-system-manager')
@click.argument(u'email')
@click.option(u'--first-name')
@click.option(u'--last-name')
@click.option(u'--send-welcome-email', default=False, is_flag=True)
@pass_context
def add_system_manager(context, email, first_name, last_name, send_welcome_email):
 import frappe.utils.user
 for site in context.sites:
  frappe.connect(site=site)
  try:
   frappe.utils.user.add_system_manager(email, first_name, last_name, send_welcome_email)
   frappe.db.commit()
  finally:
   frappe.destroy()

@ click . command ( u'add-system-manager' ) @ click . argument ( u'email' ) @ click . option ( u'--first-name' ) @ click . option ( u'--last-name' ) @ click . option ( u'--send-welcome-email' , default = False , is_flag = True ) @ pass_context def add_system_manager ( context , email , first_name , last_name , send_welcome_email ) : import frappe . utils . user for site in context . sites : frappe . connect ( site = site ) try : frappe . utils . user . add_system_manager ( email , first_name , last_name , send_welcome_email ) frappe . db . commit ( ) finally : frappe . destroy ( )
add a new system manager to a site .