old_contents: from __future__ import unicode_literals
  import frappe
  from frappe.core.doctype.user.user import create_contact
  import re
  
  def execute():
  	""" Create Contact for each User if not present """
  	frappe.reload_doc('contacts', 'doctype', 'contact')
  	frappe.reload_doc('core', 'doctype', 'dynamic_link')
  
  	if not frappe.__version__.startswith('11'):
  		frappe.reload_doc('contacts', 'doctype', 'contact_email')
  		frappe.reload_doc('contacts', 'doctype', 'contact_phone')
  
  	users = frappe.get_all('User', filters={"name": ('not in', 'Administrator, Guest')}, fields=["*"])
  	for user in users:
  		if user.first_name:
  			user.first_name = re.sub("[<>]+", '', frappe.safe_decode(user.first_name))
  		if user.last_name:
  			user.last_name  = re.sub("[<>]+", '', frappe.safe_decode(user.last_name))
  		create_contact(user, ignore_links=True, ignore_mandatory=True)
  
new_contents: from __future__ import unicode_literals
  import frappe
  from frappe.core.doctype.user.user import create_contact
  import re
  
  def execute():
  	""" Create Contact for each User if not present """
  	frappe.reload_doc('contacts', 'doctype', 'contact')
  	frappe.reload_doc('core', 'doctype', 'dynamic_link')
  
  	contact_meta = frappe.get_meta("Contact")
  	if contact_meta.has_field("phone_nos") and contact_meta.has_field("email_ids"):
  		frappe.reload_doc('contacts', 'doctype', 'contact_phone')
  		frappe.reload_doc('contacts', 'doctype', 'contact_email')
  
  	users = frappe.get_all('User', filters={"name": ('not in', 'Administrator, Guest')}, fields=["*"])
  	for user in users:
  		if user.first_name:
  			user.first_name = re.sub("[<>]+", '', frappe.safe_decode(user.first_name))
  		if user.last_name:
  			user.last_name  = re.sub("[<>]+", '', frappe.safe_decode(user.last_name))
  		create_contact(user, ignore_links=True, ignore_mandatory=True)
  
subject: use meta instead of version