def enable(self, requester, preserve_membership):
        # avoid circular dependency
        from grouper.group import get_groups_by_user
        if not preserve_membership:
            for group, group_edge in get_groups_by_user(self.session, self):
                group_obj = self.session.query(Group).filter_by(
                    groupname=group.name
                ).scalar()
                if group_obj:
                    group_obj.revoke_member(
                        requester, self, "group membership stripped as part of re-enabling account."
                    )

        self.enabled = True
        Counter.incr(self.session, "updates")
Enable a disabled user.
dataset/ETHPy150Open dropbox/grouper/grouper/model_soup.py/User.enable