code: def manage_admins():
      
      build = g.build
  
      # Do not show cached data
      db.session.add(build)
      db.session.refresh(build)
  
      add_form = forms.AddAdminForm()
      if add_form.validate_on_submit():
  
          invitation_user_id = '%s:%s' % (
              models.User.EMAIL_INVITATION, add_form.email_address.data)
  
          invitation_user = models.User.query.get(invitation_user_id)
          if not invitation_user:
              invitation_user = models.User(
                  id=invitation_user_id,
                  email_address=add_form.email_address.data)
              db.session.add(invitation_user)
  
          db.session.add(build)
          db.session.add(invitation_user)
          db.session.refresh(build, lockmode='update')
  
          build.owners.append(invitation_user)
          save_admin_log(build, invited_new_admin=True,
                         message=invitation_user.email_address)
  
          db.session.commit()
  
          logging.info('Added user=%r as owner to build_id=%r',
                       invitation_user.id, build.id)
          return redirect(url_for('manage_admins', build_id=build.id))
  
      add_form.build_id.data = build.id
  
      revoke_form_list = []
      for user in build.owners:
          form = forms.RemoveAdminForm()
          form.user_id.data = user.id
          form.build_id.data = build.id
          form.revoke.data = True
          revoke_form_list.append((user, form))
  
      return render_template(
          'view_admins.html',
          build=build,
          add_form=add_form,
          revoke_form_list=revoke_form_list)
docs: Page for viewing and managing build admins.