'Update affiliations'

@staticmethod
def org_group_team_onaccept(form):

    from pr import OU
    if hasattr(form, 'vars'):
        _id = form.vars.id
    elif (isinstance(form, Row) and ('id' in form)):
        _id = form.id
    else:
        return
    if (not _id):
        return
    db = current.db
    table = db.org_group_team
    record = db((table.id == _id)).select(table.group_id, table.org_group_id, limitby=(0, 1)).first()
    if record:
        org_group = ('org_group', record.org_group_id)
        pr_group = ('pr_group', record.group_id)
        current.s3db.pr_add_affiliation(org_group, pr_group, role='Groups', role_type=OU)
