def _get_contact_type(user):
 contact_type_name = getattr(settings, 'HARDTREE_IDENTITIES_DEFAULT_TYPE', 'person')
 contact_type = Object.filter_permitted(user, ContactType.objects).filter(name__iexact=contact_type_name)
 try:
  contact_type = contact_type[0]
 except IndexError:
  contact_type = None
 return contact_type

def _get_contact_type ( user ) : contact_type_name = getattr ( settings , 'HARDTREE_IDENTITIES_DEFAULT_TYPE' , 'person' ) contact_type = Object . filter_permitted ( user , ContactType . objects ) . filter ( name__iexact = contact_type_name ) try : contact_type = contact_type [ 0 ] except IndexError : contact_type = None return contact_type
returns default contact_type for integration .