def publish_page(page, user, language):
 page = page.reload()
 if (not page.has_publish_permission(user)):
  raise PermissionDenied()
 with current_user(user.get_username()):
  page.publish(language)
 return page.reload()

def publish_page ( page , user , language ) : page = page . reload ( ) if ( not page . has_publish_permission ( user ) ) : raise PermissionDenied ( ) with current_user ( user . get_username ( ) ) : page . publish ( language ) return page . reload ( )
publish a page .