@gen.engine
  def Transform(self, client, viewpoint, callback):
    from viewpoint import Viewpoint
    from viewfinder.backend.www import system_users

    if viewpoint.type == Viewpoint.SYSTEM:
      episodes, _ = yield gen.Task(Viewpoint.QueryEpisodes, client, viewpoint.viewpoint_id)
      if len(episodes) == 0:
        # Remove reference to cover photo.
        viewpoint.cover_photo = None
        self._LogUpdate(viewpoint)
        if Version._mutate_items:
          yield gen.Task(viewpoint.Update, client)

        # Delete share_existing activities.
        activities, _ = yield gen.Task(Viewpoint.QueryActivities, client, viewpoint.viewpoint_id)
        for activity in activities:
          if activity.name == 'share_existing':
            logging.info(activity.activity_id % 'removing activity %s')
            if Version._mutate_items:
              yield gen.Task(activity.Delete, client)

        # Remove comment reference to photo asset.
        comments, _ = yield gen.Task(Viewpoint.QueryComments, client, viewpoint.viewpoint_id)
        for comment in comments:
          if comment.asset_id is not None:
            comment.asset_id = None
            self._LogUpdate(comment)
            if Version._mutate_items:
              yield gen.Task(comment.Update, client)

    callback(viewpoint)


# Append new version migrations here.
# MAINTAIN THE ORDERING!
# ONLY DELETE OLDEST CLASSES IN ORDER!
# IF YOU DELETE, MAKE SURE TO UPDATE Version._DELETED_MIGRATOR_COUNT.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/versions.py/RepairWelcomeConvos2.Transform/swapped operands of `%`