def _change_activity_status(committer_id, activity_id, activity_type, new_status, commit_message):
 activity_rights = _get_activity_rights(activity_type, activity_id)
 old_status = activity_rights.status
 activity_rights.status = new_status
 if (activity_type == feconf.ACTIVITY_TYPE_EXPLORATION):
  cmd_type = CMD_CHANGE_EXPLORATION_STATUS
 elif (activity_type == feconf.ACTIVITY_TYPE_COLLECTION):
  cmd_type = CMD_CHANGE_COLLECTION_STATUS
 commit_cmds = [{'cmd': cmd_type, 'old_status': old_status, 'new_status': new_status}]
 if (new_status != ACTIVITY_STATUS_PRIVATE):
  activity_rights.viewer_ids = []
  if (activity_rights.first_published_msec is None):
   activity_rights.first_published_msec = utils.get_current_time_in_millisecs()
 _save_activity_rights(committer_id, activity_rights, activity_type, commit_message, commit_cmds)
 _update_activity_summary(activity_type, activity_rights)

def _change_activity_status ( committer_id , activity_id , activity_type , new_status , commit_message ) : activity_rights = _get_activity_rights ( activity_type , activity_id ) old_status = activity_rights . status activity_rights . status = new_status if ( activity_type == feconf . ACTIVITY_TYPE_EXPLORATION ) : cmd_type = CMD_CHANGE_EXPLORATION_STATUS elif ( activity_type == feconf . ACTIVITY_TYPE_COLLECTION ) : cmd_type = CMD_CHANGE_COLLECTION_STATUS commit_cmds = [ { 'cmd' : cmd_type , 'old_status' : old_status , 'new_status' : new_status } ] if ( new_status != ACTIVITY_STATUS_PRIVATE ) : activity_rights . viewer_ids = [ ] if ( activity_rights . first_published_msec is None ) : activity_rights . first_published_msec = utils . get_current_time_in_millisecs ( ) _save_activity_rights ( committer_id , activity_rights , activity_type , commit_message , commit_cmds ) _update_activity_summary ( activity_type , activity_rights )
change the status of an activity .