def add_default_values(doc, user_name, user_type, **kwargs):
    """
    Adds user_name, user_type, is_active: True, needs_activation: False and the values passed to **kwargs to doc.
    """
    doc['username'] = user_name.strip()
    doc['user_type'] = 'user' if user_type is None else user_type
    doc['is_active'] = True
    doc['is_enabled'] = True
    doc['needs_activation'] = False
    doc.update(**kwargs)
