def _add_person_to_group(person, group):
    """ Call datastores after adding a person to a group. """
    from karaage.datastores import add_accounts_to_group
    from karaage.datastores import add_accounts_to_project
    from karaage.datastores import add_accounts_to_institute

    a_list = person.account_set
    add_accounts_to_group(a_list, group)
    for project in group.project_set.all():
        add_accounts_to_project(a_list, project)
    for institute in group.institute_set.all():
        add_accounts_to_institute(a_list, institute)